/** * This method is overridden so that any object can be viewed in the debugger * as an HTML snippet. * * @return a string representation of the object */ @Override public String toString() { if (element == null) { return "(null handle)"; } return getElement().getString(); }
/** * This method is overridden so that any object can be viewed in the debugger * as an HTML snippet. * * @return a string representation of the object */ @Override public String toString() { if (element == null) { return "(null handle)"; } return getElement().getString(); }
/** * This method is overridden so that any object can be viewed in the debugger * as an HTML snippet. * * @return a string representation of the object */ @Override public String toString() { if (element == null) { return "(null handle)"; } return getElement().getString(); }
public RadioGroup(Renderer<K> renderer) { this.renderer = renderer; initWidget(wrapperPanel); groupString = getElement().getString(); }
@Override protected void render(Context context, SafeHtml data, SafeHtmlBuilder sb) { Icon icon = GWT.create(Icon.class); if (tooltip != null) { icon.setTitle(tooltip); } icon.setSize(iconSize); icon.setType(iconType); sb.appendHtmlConstant(icon.getElement().getString()); }
@Override protected void render(Context context, SafeHtml data, SafeHtmlBuilder sb) { Icon icon = GWT.create(Icon.class); if (tooltip != null) { icon.setTitle(tooltip); } icon.setSize(iconSize); icon.setType(iconType); sb.appendHtmlConstant(icon.getElement().getString()); }
private String createIconHtml(IconType iconType) { // Fix incorrect handle width when using icons setHandleWidth("30"); final Icon icon = new Icon(iconType); icon.setSize(IconSize.LARGE); return icon.getElement().getString(); }
private String createIconHtml(IconType iconType) { // Fix incorrect handle width when using icons setHandleWidth("30"); final Icon icon = new Icon(iconType); icon.setSize(IconSize.LARGE); return icon.getElement().getString(); }
/** * Get a SafeHtml representation of the header that includes an image and some text. * @param image the {@link ImageResource} to add next to the header * @param text the header text * @return the header as SafeHtml */ public static SafeHtml getHeaderSafeHtml(final ImageResource image, final String text) { HeaderHTML headerHTML = new HeaderHTML(); headerHTML.setText(text); headerHTML.setImageResource(image); return toSafeHtml(headerHTML.getElement().getString()); }
/** * Get a HTML representation of the header that includes an image and some text. * @param image the {@link ImageResource} to add next to the header * @param text the header text * @return the header as HTML */ public static HTML getHeaderHTML(final ImageResource image, final String text) { HeaderHTML headerHTML = new HeaderHTML(); headerHTML.setText(text); headerHTML.setImageResource(image); return new HTML(headerHTML.getElement().getString()); }
/** * Get a HTML representation of the header that includes an image and some text. * @param image the {@link ImageResource} to add next to the header * @param text the header text * @return the header as HTML */ public static HTML getHeaderHTML(final ImageResource image, final String text) { HeaderHTML headerHTML = new HeaderHTML(); headerHTML.setText(text); headerHTML.setImageResource(image); return new HTML(headerHTML.getElement().getString()); }
/** * Get a SafeHtml representation of the header that includes an image and some text. * @param image the {@link ImageResource} to add next to the header * @param text the header text * @return the header as SafeHtml */ public static SafeHtml getHeaderSafeHtml(final ImageResource image, final String text) { HeaderHTML headerHTML = new HeaderHTML(); headerHTML.setText(text); headerHTML.setImageResource(image); return toSafeHtml(headerHTML.getElement().getString()); }
/** * Get a string representation of the header that includes an image and some * text. * @param image the {@link ImageResource} to add next to the header * @param text the header text * @return the header as a string */ public static HTML getHeaderHTML(ImageResource image, String text) { HeaderHTML headerHTML = new HeaderHTML(); headerHTML.setText(text); headerHTML.setImageResource(image); return new HTML(headerHTML.getElement().getString()); }
public void render( final Cell.Context context, final T value, final SafeHtmlBuilder sb ) { final SafeHtmlBuilder mysb = new SafeHtmlBuilder(); final Button btn = GWT.create( Button.class ); btn.setText( getText( value ) ); btn.setTitle( getText( value ) ); btn.setType( ButtonType.DEFAULT ); btn.setSize( ButtonSize.SMALL ); btn.getElement().getStyle().setMarginRight( 5, Style.Unit.PX ); mysb.appendHtmlConstant( btn.getElement().getString() ); sb.append( mysb.toSafeHtml() ); }
public void render(final Cell.Context context, final T value, final SafeHtmlBuilder sb) { final SafeHtmlBuilder mysb = new SafeHtmlBuilder(); final Button btn = GWT.create(Button.class); btn.setText(getText(value)); btn.setTitle(getText(value)); btn.setType(ButtonType.DEFAULT); btn.setSize(size); btn.getElement().getStyle().setMarginRight(5, Style.Unit.PX); mysb.appendHtmlConstant(btn.getElement().getString()); sb.append(mysb.toSafeHtml()); }
private Widget buildDescription(final String caption) { return new AbstractTextWidget(Document.get().createSpanElement()) {{ addStyleName("text-uppercase"); setTitle(CommonConstants.INSTANCE.ClickToDisplay0(caption)); setHTML(new Strong(caption).getElement().getString()); }}; } }
private Widget buildDescription(final String caption) { return new AbstractTextWidget(Document.get().createSpanElement()) {{ addStyleName("text-uppercase"); setTitle(CommonConstants.INSTANCE.ClickToDisplay0(caption)); setHTML(new Strong(caption).getElement().getString()); }}; } }
public final boolean setCaption(String caption, Icon icon, String captionStyleName) { DivElement captionElement = getFirstChildElement().cast(); boolean hasIcon = icon != null; boolean needsCaption = hasIcon || (caption != null && !caption.isEmpty()); if (needsCaption) { String captionHtml = hasIcon ? icon.getElement().getString() : ""; captionHtml += caption == null ? "" : caption; captionElement.setInnerHTML(captionHtml); captionElement.getStyle().setProperty("display", null); // copy v-caption prefixed styles from widget to caption captionElement.setClassName(captionStyleName); setClassName(ROW_CLASSNAME + " " + ROW_WITH_CAPTION_STYLENAME); } else { setClassName(ROW_CLASSNAME + " " + ROW_WITHOUT_CAPTION_STYLENAME); } return needsCaption; }
/** * Helper function to build html snippet for column or row headers. * * @param uidl * possibly with values caption and icon * @return html snippet containing possibly an icon + caption text */ protected String buildCaptionHtmlSnippet(UIDL uidl) { String s = uidl.hasAttribute("caption") ? uidl.getStringAttribute("caption") : ""; if (uidl.hasAttribute("icon")) { Icon icon = client.getIcon(uidl.getStringAttribute("icon")); icon.setAlternateText("icon"); s = icon.getElement().getString() + s; } return s; }
/** * Shows the uiObject content in a printable form in a new window * @param uiObject */ public static void print(UIObject uiObject){ String headTag = ""; String styleTags = ""; NodeList<com.google.gwt.dom.client.Element> head = Document.get().getElementsByTagName("head"); if(head.getItem(0) != null){ com.google.gwt.dom.client.Element e = head.getItem(0); NodeList<com.google.gwt.dom.client.Element> styles = e.getElementsByTagName("style"); for(int i = 0; i < styles.getLength(); i++){ styleTags = styleTags + styles.getItem(i).getString(); } } headTag = "<HEAD><TITLE>Print - " + Window.getTitle() + "</TITLE>" + styleTags + "</HEAD>"; openPrintWindow(uiObject.getElement().getString(), headTag, num); num++; }