Example usage for com.google.gwt.dom.client SpanElement as

List of usage examples for com.google.gwt.dom.client SpanElement as

Introduction

In this page you can find the example usage for com.google.gwt.dom.client SpanElement as.

Prototype

public static SpanElement as(Element elem) 

Source Link

Document

Assert that the given Element is compatible with this class and automatically typecast it.

Usage

From source file:fr.putnami.pwt.core.widget.client.Text.java

License:Open Source License

public Text() {
    super(SpanElement.TAG);
    this.span = SpanElement.as(this.getElement());
}

From source file:fr.putnami.pwt.core.widget.client.Text.java

License:Open Source License

public Text(Text source) {
    super(source);
    this.span = SpanElement.as(this.getElement());
    this.span.setInnerText(source.text);
}

From source file:org.bonitasoft.console.client.admin.organization.users.view.UserMoreDetailsAdminPage.java

License:Open Source License

private Definition emailDefinition(final AbstractContactDataItem contactData, String tooltip) {
    String email = contactData.getEmail() != null ? contactData.getEmail() : "";
    SpanElement span = SpanElement
            .as(Element.as(SafeHtmlParser.parseFirst(UserMetadataBuilder.TEMPLATES.email(email))));
    Definition definition = new Definition(_("Email") + ": ", new Html(span));
    definition.addClass(CssClass.BREAK_WORD);
    definition.addClass("metadatas");
    return definition;
}

From source file:org.bonitasoft.console.client.common.metadata.UserMetadataBuilder.java

License:Open Source License

private ItemDetailsMetadata eMail(AbstractContactDataItem contact) {
    String email = contact.getEmail() == null ? _("No data") : contact.getEmail();
    SpanElement span = SpanElement.as(Element.as(SafeHtmlParser.parseFirst(TEMPLATES.email(email))));
    Definition definition = new Definition(_("Email") + ": ", new Html(span));
    definition.addClass("email");
    return new ItemDetailsMetadata(new DeployedAttributeReader(UserItem.DEPLOY_PROFESSIONAL_DATA,
            ProfessionalContactDataItem.ATTRIBUTE_EMAIL), new Html(definition.getElement()));
}

From source file:org.nuxeo.ecm.platform.annotations.gwt.client.util.GwtTestXPathUtil.java

License:Apache License

public void _testGetXPathDecoratedDocument() {
    createDocument();/*from  w ww.j  a v  a2  s.co  m*/
    List<Node> nodes = xPathUtil.getNode("/html[0]/body[0]/div[0]/b[0]/span[1]", Document.get());
    assertNotNull(nodes);
    Node node = nodes.get(0);
    SpanElement span = SpanElement.as(node).cast();
    assertNotNull(span);
    assertEquals("c", span.getInnerHTML());
    node = RootPanel.get("myspan").getElement();
    String xpath = xPathUtil.getXPath(node);
    assertEquals(xpath.toLowerCase(), "/html[0]/body[0]/div[0]/b[0]/span[1]");
}

From source file:org.nuxeo.ecm.platform.annotations.gwt.client.util.XPathUtil.java

License:Apache License

private boolean isIgnored(Node node) {
    int nodeType = node.getNodeType();
    if (nodeType != Node.ELEMENT_NODE && nodeType != Node.TEXT_NODE) {
        return true; // ignore non element and non text node
    }/*from   w  w w. j  av a 2s  .c  o m*/
    if (node.getNodeName().equalsIgnoreCase("span")) {
        SpanElement spanElement = SpanElement.as(node).cast();
        String name = spanElement.getClassName();
        if (name == null) {
            return false;
        }
        return name.contains(AnnotationConstant.IGNORED_ELEMENT);
    } else if (node.getNodeName().equalsIgnoreCase("div")) {
        DivElement divElement = DivElement.as(node).cast();
        return divElement.getClassName().equals(AnnotationConstant.IGNORED_ELEMENT);
    }
    return false;
}

From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.GwtTestDecoratorVisitor.java

License:Apache License

public void testStraight() {
    createDocument();//from   w  ww .  j  a  v  a2s.  c o  m
    Element bNode = RootPanel.getBodyElement().getElementsByTagName("b").getItem(0);
    assertNotNull(bNode);

    AnnoteaDecoratorVisitor processor = new AnnoteaDecoratorVisitor(bNode, 8, 13, getDefaultAnnotation(), null);
    Visitor visitor = new Visitor(processor);
    visitor.process(bNode);
    assertNotNull(bNode);

    NodeList list = bNode.getChildNodes();
    SpanElement span = SpanElement.as(bNode.getParentElement());
    assertEquals(3, list.getLength());
    assertEquals(span.getInnerHTML(),
            "<b>Nuxeo EP 5 - <span class=\"decorate decorate0\">Nuxeo An</span>notation</b>");

    processor = new AnnoteaDecoratorVisitor(bNode, 5, 23, getDefaultAnnotation(), null);
    visitor = new Visitor(processor);
    visitor.process(bNode);
    assertEquals(5, bNode.getChildNodes().getLength());
    assertEquals(span.getInnerHTML(),
            "<b>Nuxeo EP 5 - <span class=\"decorate decorate0\">Nuxeo An</span>no<span class=\"decorate decorate0\">tatio</span>n</b>");
}

From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.GwtTestDecoratorVisitor.java

License:Apache License

public void testReverse() {
    createDocument();//  w  w w .  j  a va 2s  .  co m
    Element bNode = RootPanel.getBodyElement().getElementsByTagName("b").getItem(0);
    assertNotNull(bNode);

    AnnoteaDecoratorVisitor processor = new AnnoteaDecoratorVisitor(bNode, 5, 23, getDefaultAnnotation(), null);
    Visitor visitor = new Visitor(processor);
    visitor.process(bNode);
    assertNotNull(bNode);

    NodeList list = bNode.getChildNodes();
    SpanElement span = SpanElement.as(bNode.getParentElement());
    assertEquals(3, list.getLength());
    assertEquals(span.getInnerHTML(),
            "<b>Nuxeo EP 5 - Nuxeo Anno<span class=\"decorate decorate0\">tatio</span>n</b>");

    processor = new AnnoteaDecoratorVisitor(bNode, 8, 13, getDefaultAnnotation(), null);
    visitor = new Visitor(processor);
    visitor.process(bNode);
    assertEquals(5, bNode.getChildNodes().getLength());
    assertEquals(span.getInnerHTML(),
            "<b>Nuxeo EP 5 - <span class=\"decorate decorate0\">Nuxeo An</span>no<span class=\"decorate decorate0\">tatio</span>n</b>");
}

From source file:org.openxdata.designer.client.view.SkipRulesView.java

/**
 * Creates a new instance of the skip logic widget.
 *//*from   www  . jav a2 s.c  o m*/
public SkipRulesView() {
    verticalPanel = uiBinder.createAndBindUi(this);

    initWidget(verticalPanel);

    // set localized text on some of the widgets
    // TODO(droberge): Determine if there is a way to set localized text in XML
    lblAction.setInnerText(formsConstants.forQuestion());
    lblAnd.setInnerText(formsConstants.and());
    otherQts.setText(formsConstants.clickForOtherQuestions());
    addConditionButton.setText(formsConstants.addCondition());

    SpanElement conditionSpan = SpanElement.as(conditionPanel.getElementById("whenSpan"));
    conditionSpan.setInnerText(formsConstants.when());

    conditionSpan = SpanElement.as(conditionPanel.getElementById("followingSpan"));
    conditionSpan.setInnerText(formsConstants.ofTheFollowingApply());
}