/** * Creates a hyperlink with its html and target history token specified. * * @param html the hyperlink's safe html * @param targetHistoryToken the history token to which it will link * @see #setTargetHistoryToken */ public Hyperlink(SafeHtml html, String targetHistoryToken) { this(html.asString(), true, targetHistoryToken); }
/** * Creates a button with the given HTML caption. * * @param html the HTML caption */ public SubmitButton(SafeHtml html) { this(html.asString()); }
/** * Creates a button with the given HTML caption and click listener. * * @param html the html caption * @param handler the click handler */ public Button(SafeHtml html, ClickHandler handler) { this(html.asString(), handler); }
/** * Creates a button with the given HTML caption and click listener. * * @param html the HTML caption * @param handler the click handler */ public ResetButton(SafeHtml html, ClickHandler handler) { this(html.asString(), handler); }
/** * Constructs a CaptionPanel with specified caption text. * * @param caption the text of the caption */ public CaptionPanel(SafeHtml caption) { this(caption.asString(), true); }
/** * Initializes the panel's HTML from a given {@link SafeHtml} object. * * Similar to {@link #HTMLPanel(String)} * * @param safeHtml the html to set. */ public HTMLPanel(SafeHtml safeHtml) { this(safeHtml.asString()); }
/** * Constructs a new menu item that fires a command when it is selected. * * @param html the item's html text */ public MenuItem(SafeHtml html) { this(html.asString(), true); }
/** * Creates an HTML widget with the specified contents and with the * specified direction. * * @param html the new widget's SafeHtml contents * @param dir the content's direction. Note: {@code Direction.DEFAULT} means * direction should be inherited from the widget's parent element. */ public InlineHTML(SafeHtml html, Direction dir) { this(html.asString(), dir); }
/** * Creates a hyperlink with its html and target history token specified. * * @param html the hyperlink's html * @param dir the html's direction * @param targetHistoryToken the history token to which it will link * @see #setTargetHistoryToken */ public InlineHyperlink(SafeHtml html, Direction dir, String targetHistoryToken) { this(html.asString(), true, dir, targetHistoryToken); }
/** * Compares this string to the specified object. */ @Override public boolean equals(Object obj) { if (!(obj instanceof SafeHtml)) { return false; } return html.equals(((SafeHtml) obj).asString()); }
/** * All of the markup and content within a given element. */ public final void setInnerSafeHtml(SafeHtml html) { setInnerHTML(html.asString()); }
/** * Sets this object's contents via known-safe HTML. * * @see com.google.gwt.safehtml.client.HasSafeHtml#setHTML(SafeHtml) * @param html the html to set. */ public void setHTML(SafeHtml html) { setHTML(html.asString()); }
/** * Sets the caption for the panel using a SafeHtml string. * * @param html HTML for the new caption; must not be <code>null</code> */ public void setCaptionHTML(SafeHtml html) { setCaptionHTML(html.asString()); }
/** * Set the face's contents as html. * * @param html html to set as face's contents html */ @Override public void setHTML(SafeHtml html) { setHTML(html.asString()); }
/** * Inserts a new tab at the specified index. * * @param html the new tab's html * @param beforeIndex the index before which this tab will be inserted */ public void insertTab(SafeHtml html, int beforeIndex) { insertTab(html.asString(), true, beforeIndex); }
/** * Creates an anchor with its html and href (target URL) specified. * * @param html the anchor's html * @param dir the html's direction * @param href the url to which it will link */ public Anchor(SafeHtml html, Direction dir, @IsSafeUri String href) { this(html.asString(), true, dir, href); }
/** * Adds a child widget to this stack, along with a widget representing the * stack header. * * @param widget the child widget to be added * @param header the html to be shown on its header * @param headerSize the size of the header widget */ public void add(final Widget widget, SafeHtml header, double headerSize) { add(widget, header.asString(), true, headerSize); }
/** * Creates an anchor with its html and href (target URL) specified. * * @param html the anchor's html * @param href the url to which it will link */ public Anchor(SafeHtml html, SafeUri href) { this(html.asString(), true, href.asString()); }
/** * @see BidiFormatter#dirAttr(String, boolean) * * @param html Html whose direction is to be estimated * @return "dir=rtl" for RTL text in non-RTL context; "dir=ltr" for LTR text * in non-LTR context; else, the empty string. */ public SafeHtml dirAttr(SafeHtml html) { return cachedSafeHtml(dirAttrBase(html.asString(), true)); }
/** * Estimates the direction of a SafeHtml. * * @param html The string to check. * @return {@code html}'s estimated direction. */ public Direction estimateDirection(SafeHtml html) { return estimateDirection(BidiUtils.get().stripHtmlIfNeeded(html.asString(), true)); } }