Example usage for com.google.gwt.user.client.ui InlineHTML InlineHTML

List of usage examples for com.google.gwt.user.client.ui InlineHTML InlineHTML

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui InlineHTML InlineHTML.

Prototype

protected InlineHTML(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:at.ait.dme.yuma.client.image.annotation.ImageAnnotationTreeNode.java

License:EUPL

/**
 * adds the body (title and text)//w ww  .j ava  2s .c om
 */
public void addBody() {
    title.setText(annotation.getTitle());
    title.setStyleName("imageAnnotation-title");

    text.setStyleName("imageAnnotation-text");
    text.setHTML(annotation.getText());

    if (title.getText() != null)
        annotationPanel.add(title);
    annotationPanel.add(text);

    // Semantic tags
    if (annotation.hasSemanticTags()) {
        FlowPanel tagPanel = new FlowPanel();
        tagPanel.setStyleName("imageAnnotation-taglist");
        for (SemanticTag t : annotation.getSemanticTags()) {
            InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + t.getURI() + "\" title=\""
                    + t.getDescription() + "\">" + t.getTitle() + "</a>");
            tagPanel.add(span);
        }
        annotationPanel.add(tagPanel);
    }
}

From source file:at.ait.dme.yuma.client.map.annotation.TagEnabledMapAnnotationForm.java

License:EUPL

@Override
public void addTag(SemanticTag tag) {
    InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + tag.getURI() + "\" title=\""
            + tag.getDescription() + "\">" + tag.getTitle() + "</a>");
    tagPanel.add(span);/*  w w w. ja v  a  2 s.  c o m*/
    tags.put(tag, span);
    annotationComposite.layout();
}

From source file:at.ait.dme.yuma.client.map.explore.KMLOverlayPanel.java

License:EUPL

private HorizontalPanel createRadioButton(final String kml, String label, boolean preselected) {
    HorizontalPanel panel = new HorizontalPanel();
    RadioButton radio = new RadioButton(RADIO_GROUP);
    radio.setValue(preselected);/*from w w w .  ja  va 2  s . c om*/
    radio.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (kml != null) {
                kmlLayer.showKml(kml);
            } else {
                kmlLayer.hideKml();
            }
        }
    });
    panel.add(radio);
    panel.add(new InlineHTML(label));
    return panel;
}

From source file:at.ait.dme.yuma.client.map.MapPopup.java

License:EUPL

public MapPopup(String title, String html, LonLat lonlat, Map map, ClickHandler closeHandler) {
    this.lonlat = lonlat;
    this.map = map;
    this.setStyleName("mapPopup");

    FlowPanel header = new FlowPanel();
    header.setStyleName("title");
    header.add(new InlineHTML(title));

    PushButton closeButton = new PushButton("X");
    closeButton.setStyleName("close");
    closeButton.addClickHandler(closeHandler);
    header.add(closeButton);/*from   w ww. j a  v a 2  s.  c  om*/

    FlowPanel inner = new FlowPanel();
    inner.setStyleName("inner");
    inner.add(new InlineHTML(html));

    moveListener = new EventListener() {
        @Override
        public void onEvent(LonLat ll, Pixel p, String tagname) {
            updatePosition();
        }
    };
    map.registerMapEventListener(moveListener, Map.EVENT_MOVE);

    FlowPanel panel = new FlowPanel();
    panel.add(header);
    panel.add(inner);

    this.setWidget(panel);

    DeferredCommand.addCommand(new Command() {
        @Override
        public void execute() {
            updatePosition();
        }
    });
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java

License:EUPL

@Override
public void addTag(final SemanticTag tag) {
    if (tag == null)
        return;//from   w w w .  j a  v a2s .  c o  m

    if (tags.containsKey(tag))
        return;

    FlowPanel container = new FlowPanel();

    InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + tag.getURI() + "\" title=\""
            + tag.getPrimaryDescription() + "\">" + tag.getPrimaryLabel() + "</a>");
    container.add(span);

    PushButton x = new PushButton(new Image(DELETE_TAG_ICON));
    x.setTitle("Remove Tag '" + tag.getPrimaryLabel() + "'");
    x.setStyleName("annotationEditForm-tag-btn-delete");
    x.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            removeTag(tag);
        }
    });
    container.add(x);

    tagPanel.add(container);
    tags.put(tag, container);
    panel.layout();
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationTreeNode.java

License:EUPL

public ImageAnnotationTreeNode(AnnotationPanel panel, Annotation annotation, AnnotationTreeNode parent) {

    super(panel, annotation, parent);
    container.add(createHeader());/*from w ww.  ja va2s  . c o m*/

    Label title = new Label(annotation.getTitle());
    title.setStyleName("imageAnnotation-title");
    title.getElement().setAttribute("property", "dc:title");
    container.add(title);

    InlineHTML text = new InlineHTML(annotation.getText());
    text.getElement().setAttribute("property", "rdfs:label");
    text.setStyleName("imageAnnotation-text");
    container.add(text);

    if (annotation.hasTags()) {
        FlowPanel tagPanel = new FlowPanel();
        tagPanel.setStyleName("imageAnnotation-taglist");
        for (SemanticTag t : annotation.getTags()) {
            InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + t.getURI() + "\" title=\""
                    + t.getPrimaryDescription() + "\">" + t.getPrimaryLabel() + "</a>");
            span.getElement().setAttribute("rel", t.getURI());
            tagPanel.add(span);
        }
        container.add(tagPanel);
    }

    container.add(createActions());
    container.getElement().setAttribute("typeof", "oac:Annotation");
    container.getElement().setAttribute("about",
            YUMACoreProperties.getRDFBaseUrl() + annotation.getId() + ".oac");
    initWidget(container);
    deselect();
}

From source file:at.ait.dme.yuma.suite.apps.map.client.widgets.MapPopup.java

License:EUPL

public MapPopup(String title, String html, LonLat lonlat, Map map, ClickHandler closeHandler) {
    this.lonlat = lonlat;
    this.map = map;
    this.setStyleName("mapPopup");

    FlowPanel header = new FlowPanel();
    header.setStyleName("title");
    header.add(new InlineHTML(title));

    PushButton closeButton = new PushButton("X");
    closeButton.setStyleName("close");
    closeButton.addClickHandler(closeHandler);
    header.add(closeButton);/*from   ww  w  . ja v  a 2  s.co m*/

    FlowPanel inner = new FlowPanel();
    inner.setStyleName("inner");
    inner.add(new InlineHTML(html));

    moveListener = new EventListener() {
        @Override
        public void onEvent(LonLat ll, Pixel p, String tagname) {
            updatePosition();
        }
    };
    map.registerMapEventListener(moveListener, Map.EVENT_MOVE);

    FlowPanel panel = new FlowPanel();
    panel.add(header);
    panel.add(inner);

    this.setWidget(panel);

    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override
        public void execute() {
            updatePosition();
        }
    });
}

From source file:cc.alcina.framework.gwt.client.gwittir.widget.ExpandableLabel.java

License:Apache License

@Override
public void setValue(Object o) {
    fp.clear();/*  w  w  w . j  a va  2s .c om*/
    if (o == null) {
        // fp.add(new InlineLabel("[Undefined]"));
        return;
    }
    boolean hidden = false;
    if (o instanceof Collection) {
        ArrayList l = new ArrayList((Collection) o);
        if (l.size() > 0 && l.get(0) instanceof Comparable) {
            Collections.sort(l);
        }
        int strlen = 0;
        for (Object object : l) {
            InlineLabel comma = new InlineLabel(", ");
            if (strlen > 0) {
                fp.add(comma);
                strlen += 2;
            }
            String name = ClientReflector.get().displayNameForObject(object);
            InlineLabel label = new InlineLabel(name);
            if (strlen > getMaxLength()) {
                comma.setVisible(false);
                label.setVisible(false);
                hiddenWidgets.add(comma);
                hiddenWidgets.add(label);
                hidden = true;
            }
            strlen += name.length();
            fp.add(label);
        }
    } else {
        fullText = renderer == null ? o.toString() : renderer.render(o).toString();
        fullTextNoBrs = fullText;
        if (isShowNewlinesAsBreaks()) {
            fullText = SafeHtmlUtils.htmlEscape(fullText).replace("\n", "<br>\n");
        }
        int maxC = getMaxLength();
        int y1 = fullText.indexOf(">", maxC);
        int y2 = fullText.indexOf("<", maxC);
        int y3 = fullText.indexOf("<");
        if (y1 < y2 && y1 != -1 && y3 < maxC && !escapeHtml) {
            maxC = y1 + 1;
        }
        String vis = CommonUtils.trimToWsChars(fullText, maxC);
        com.google.gwt.user.client.ui.Label label;
        if (fullText.length() == vis.length()) {
            label = isShowNewlinesAsBreaks() ? new InlineHTML(fullText) : new InlineLabel(fullText);
            fp.add(label);
        } else {
            label = isShowNewlinesAsBreaks() ? new InlineHTML(vis) : new InlineLabel(vis);
            fp.add(label);
            hidden = true;
            if (!isShowAsPopup()) {
                String notVis = fullText.substring(vis.length());
                label = isShowNewlinesAsBreaks() ? new InlineHTML(notVis) : new InlineLabel(notVis);
                label.setVisible(false);
                fp.add(label);
                hiddenWidgets.add(label);
            }
        }
    }
    if (hidden) {
        this.dots = new InlineLabel("...");
        this.space = new InlineHTML("&nbsp;");
        fp.add(dots);
        this.hiding = true;
        this.showLink = new Link("[more]");
        this.hideLink = new Link("[less]");
        if (isShowHideAtEnd()) {
            fp.add(space);
            fp.add(hideLink);
        } else {
            fp.insert(hideLink, 0);
            fp.add(space);
        }
        hideLink.setVisible(false);
        space.setVisible(false);
        fp.add(showLink);
        hideLink.addClickHandler(showHideListener);
        showLink.addClickHandler(showHideListener);
    }
}

From source file:cc.alcina.framework.gwt.client.widget.SelectWithSearch.java

License:Apache License

protected void addDefaultSeparator(HasWidgets itemHolder) {
    itemHolder.add(new InlineHTML(" "));
}

From source file:cc.alcina.framework.gwt.client.widget.UsefulWidgetFactory.java

License:Apache License

public static Widget boldInline(String text) {
    return new InlineHTML("<b>" + text + "</b>");
}