Helper to create a button with an image and an action.

@param text the text content of the button
@param asLink indicates the button should be rendered as a link
@return a button
337146
private WButton makeImageButton(final String text, final Boolean asLink) {
		return makeImageButtonWithPosition(text, null, asLink);
	}
783325
public ListTemplateElementBuilder addUrlButton(String title, String url) {
		Button button = ButtonFactory.createUrlButton(title, url);
		this.element.addButton(button);
		return this;
	}
133879
public static JButton createActionButton (String label, String command)
    {
        JButton button = new JButton(label);
        configureAction(button, command);
        return button;
    }
875584
public Builder link(String href, String textContent) {
       text.a(textContent).a(" : ").a(href);
       tag("a", "href='" + href + "' target='_blank'");
       html.a(textContent);
       return end();
   }
409109
public function addAction($text, $url, $style = null)
    {
        $this->actions[] = [
            'type' => 'button',
            'text' => (string) $text,
            'url' => (string) $url,
            'style' => (string) $style,
        ];

        return $this;
    }
76970
def link(self, text, as_html=True) -> str:
        
        try:
            url = self.url
        except TypeError:  # URL is not accessible
            if as_html:
                return md.quote_html(text)
            return md.escape_md(text)

        if as_html:
            return md.hlink(text, url)
        return md.link(text, url)
687384
public AbstractButton addButton(final String text, final String iconImagePath, final boolean toggleButton) {
        final ImageIcon icon = ImageManager.get().getImageIcon(iconImagePath, IconUtils.ICON_SIZE_MEDIUM);
        return addButton(text, icon, toggleButton);
    }
732033
public static Label newActionLabel (String text, ClickHandler onClick)
    {
        return newActionLabel(text, null, onClick);
    }
1149748
function(cells, asText)
	{
		graph.getModel().beginUpdate();
		try
		{
			// Applies only basic text styles
			if (asText)
			{
				var edge = graph.getModel().isEdge(cell);
				var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
				var textStyles = ['fontSize', 'fontFamily', 'fontColor'];
				
				for (var j = 0; j < textStyles.length; j++)
				{
					var value = current[textStyles[j]];
					
					if (value != null)
					{
						graph.setCellStyles(textStyles[j], value, cells);
					}
				}
			}
			else
			{
				for (var i = 0; i < cells.length; i++)
				{
					var cell = cells[i];

					// Removes styles defined in the cell style from the styles to be applied
					var cellStyle = graph.getModel().getStyle(cell);
					var tokens = (cellStyle != null) ? cellStyle.split(';') : [];
					var appliedStyles = styles.slice();
					
					for (var j = 0; j < tokens.length; j++)
					{
						var tmp = tokens[j];
				 		var pos = tmp.indexOf('=');
				 					 		
				 		if (pos >= 0)
				 		{
				 			var key = tmp.substring(0, pos);
				 			var index = mxUtils.indexOf(appliedStyles, key);
				 			
				 			if (index >= 0)
				 			{
				 				appliedStyles.splice(index, 1);
				 			}
				 			
				 			// Handles special cases where one defined style ignores other styles
				 			for (var k = 0; k < keyGroups.length; k++)
				 			{
				 				var group = keyGroups[k];
				 				
				 				if (mxUtils.indexOf(group, key) >= 0)
				 				{
				 					for (var l = 0; l < group.length; l++)
				 					{
							 			var index2 = mxUtils.indexOf(appliedStyles, group[l]);
							 			
							 			if (index2 >= 0)
							 			{
							 				appliedStyles.splice(index2, 1);
							 			}
				 					}
				 				}
				 			}
				 		}
					}
	
					// Applies the current style to the cell
					var edge = graph.getModel().isEdge(cell);
					var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
					
					for (var j = 0; j < appliedStyles.length; j++)
					{
						var key = appliedStyles[j];
						var styleValue = current[key];
	
						if (styleValue != null && (key != 'shape' || edge))
						{
							// Special case: Connect styles are not applied here but in the connection handler
							if (!edge || mxUtils.indexOf(connectStyles, key) < 0)
							{
								graph.setCellStyles(key, styleValue, [cell]);
							}
						}
					}
				}
			}
		}
		finally
		{
			graph.getModel().endUpdate();
		}
	}
1201474
public void encodeHTML(FacesContext context, Button button)
	throws IOException {
		boolean idHasBeenRendered=false;
		if (button.getHref()!=null&&button.getOutcome()!=null) 
			throw new FacesException("Please define the href attribute or the outcome attribute, but not both");
		ResponseWriter rw = context.getResponseWriter();
		String clientId = button.getClientId();
		
		// add responsive style
		String clazz = Responsive.getResponsiveStyleClass(button, false).trim();
		boolean isResponsive = clazz.length() > 0;
		if (isResponsive) {
			rw.startElement("div", button);
			rw.writeAttribute("class", clazz, null);
			rw.writeAttribute("id", clientId, "id");
			idHasBeenRendered = true;
		}


		Object value = (button.getValue() != null ? button.getValue() : "");
		String style = button.getStyle();

		String tag = "button";
		if ((button.getHref() != null) || (button.getTarget() != null)) {
			tag="a";
		}
		rw.startElement(tag, button);
		if (!idHasBeenRendered) {
			rw.writeAttribute("id", clientId, "id");
		}
		rw.writeAttribute("name", clientId, "name");
		if ("button".equals(tag)) {
			rw.writeAttribute("type", "button", null);
		}
		if(BsfUtils.isStringValued(button.getDir())) {
			rw.writeAttribute("dir", button.getDir(), "dir");
		}
		if (style != null) {
			rw.writeAttribute("style", style, "style");
		}
		if (button.getHref() != null)
			rw.writeAttribute("href", button.getHref(), "href");
		if (button.getTarget() != null)
			rw.writeAttribute("target", button.getTarget(), "target");
		rw.writeAttribute("class", getStyleClasses(button, isResponsive), "class");

		Tooltip.generateTooltip(context, button, rw);

		final String clickHandler = encodeClick(context, button);
		if (null != clickHandler && clickHandler.length() > 0) {
			rw.writeAttribute("onclick", clickHandler, null);
		}
		if (BsfUtils.isStringValued(button.getDismiss())) {
			rw.writeAttribute("data-dismiss", button.getDismiss(), null);
		}
		if (button.isDisabled()) {
			rw.writeAttribute("disabled", "disabled", null);
		}

		// Encode attributes (HTML 4 pass-through + DHTML)
		renderPassThruAttributes(context, button, new String[] { "accesskey", "dir", "lang", "style", "tabindex", "title" });
		
		writeAttribute(rw, "onblur", button.getOnblur());
		writeAttribute(rw, "onchange", button.getOnchange());
		writeAttribute(rw, "onclick", button.getOnclick());
		writeAttribute(rw, "ondblclick", button.getOndblclick());
		writeAttribute(rw, "onfocus", button.getOnfocus());
		writeAttribute(rw, "onkeydown", button.getOnkeydown());
		writeAttribute(rw, "onkeypress", button.getOnkeypress());
		writeAttribute(rw, "onkeyup", button.getOnkeyup());
		writeAttribute(rw, "onmousedown", button.getOnmousedown());
		writeAttribute(rw, "onmousemove", button.getOnmousemove());
		writeAttribute(rw, "onmouseout", button.getOnmouseout());
		writeAttribute(rw, "onmouseover", button.getOnmouseover());
		writeAttribute(rw, "onmouseup", button.getOnmouseup());
		
		renderPassThruAttributes(context, button, button.getEventNames().toArray(new String[0]));


		String icon = button.getIcon();
		String faicon = button.getIconAwesome();
		boolean fa = false; // flag to indicate whether the selected icon set is
							// Font Awesome or not.
		if (faicon != null) {
			icon = faicon;
			fa = true;
		}
		if (icon != null) {
			Object ialign = button.getIconAlign(); // Default Left
			if (ialign != null && ialign.equals("right")) {
				rw.writeText(value + " ", null);
				IconRenderer.encodeIcon(rw, button, icon, fa, button.getIconSize(), button.getIconRotate(), button.getIconFlip(), button.isIconSpin(), null, null, false, false, false, false,
						button.isIconBrand(), button.isIconInverse(), button.isIconLight(), button.isIconPulse(), button.isIconRegular(), button.isIconRegular());
			} else {
				IconRenderer.encodeIcon(rw, button, icon, fa, button.getIconSize(), button.getIconRotate(), button.getIconFlip(), button.isIconSpin(), null, null, false, false, false, false,
						button.isIconBrand(), button.isIconInverse(), button.isIconLight(), button.isIconPulse(), button.isIconRegular(), button.isIconRegular());
				rw.writeText(" " + value, null);
			}

		} else {
			rw.writeText(value, null);
		}

		Tooltip.activateTooltips(context, button);
		rw.endElement(tag);
		if (isResponsive) {
			rw.endElement("div");
		}
	}
700782
public TextBuilder styledLink(final String text, final TextStyle ts, final Table table) {
        this.curParagraphBuilder.styledLink(text, ts, table);
        return this;
    }
283919
def click_link_with_text(link_text, opts = {})
        if opts && opts[:index]
          elements = find_elements(:link_text, link_text)
          elements[opts[:index]-1].click
        else
          find_element(:link_text, link_text).click
        end
      end
850393
public void typeTextInWebElement(WebElement webElement, String text){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "typeTextInWebElement("+webElement+", \""+text+"\")");
		}
		
		clickOnWebElement(webElement);
		dialogUtils.hideSoftKeyboard(null, true, true);
		instrumentation.sendStringSync(text);
	}
308914
public static Link create(final String text, final File file) {
        return new Link(text, null, file.toURI().toString());
	}
832527
public static JComponent createTitleLabel(final String text, final ActionListener backButtonActionListener) {
        final DCLabel titleLabel = new DCLabel(false, text, WidgetUtils.BG_COLOR_BLUE_DARK, null);
        titleLabel.setFont(WidgetUtils.FONT_BANNER);

        final EmptyBorder border = new EmptyBorder(adjuster.adjust(20), MARGIN_LEFT, adjuster.adjust(10), 0);

        if (backButtonActionListener != null) {
            titleLabel.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(final MouseEvent e) {
                    backButtonActionListener.actionPerformed(null);
                }
            });
            titleLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

            final DCPanel panel = DCPanel.flow(Alignment.LEFT, MARGIN_LEFT, 0,
                    createBackToWelcomeScreenButton(backButtonActionListener), titleLabel);
            panel.setBorder(border);
            return panel;
        } else {
            titleLabel.setBorder(border);
            return titleLabel;
        }
    }
64473
public function bigActionButton($linkText, array $url, $bgColor = '#368ee0', $textColor = "#ffffff")
    {
        return $this->_View->element('Wasabi/Core.Email/big-action-button', [
            'linkText' => $linkText,
            'url' => $this->Url->build($url, true),
            'bgColor' => $bgColor,
            'textColor' => $textColor
        ]);
    }
1036593
public T html(final String text) {
        if (TextUtils.isEmpty(text)) {
            return text("");
        }
        if (text.contains("<") && text.contains(">")) {
            if (view instanceof TextView)
                ((TextView)view).setMovementMethod(LinkMovementMethod.getInstance());
            return text(Html.fromHtml(text));

        } else {
            return text(text);
        }
    }