Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.SpanElement


    protected void init() {
        super.init();
        registerRpc(CustomUIConnectorRpc.class, new CustomUIConnectorRpc() {
            @Override
            public void test() {
                SpanElement span = Document.get().createSpanElement();
                span.setInnerText("This is the "
                        + Util.getSimpleName(CustomUIConnector.this));
                Document.get().getBody().insertFirst(span);
            }
        });
    }
View Full Code Here


          if (error != null) {
            message.append("Caused by: ");
          }
        }

        SpanElement elt = Document.get().createSpanElement();
        elt.setInnerText(message.toString());
        switch (event.severity) {
          case SEVERE:
            elt.setClassName(style.entry() + " " + style.severe());
            break;
          case INFO:
            elt.setClassName(style.entry() + " " + style.info());
            break;
        }

        panel.getElement().appendChild(elt);
        elt.scrollIntoView();
      }
    });
  }
View Full Code Here

*/
public class TestInlineDoodad {
  private static class TestRenderer extends RenderingMutationHandler {
    @Override
    public Element createDomImpl(Renderable element) {
      SpanElement domElement = Document.get().createSpanElement();
      return element.setAutoAppendContainer(domElement);
    }
View Full Code Here

   */
  private PointRange<Node> hijackFragment(String xmlInRange, String annotations,
      PointRange<Node> origRange) {
    Point<Node> origStart = origRange.getFirst();
    Point<Node> origEnd = origRange.getSecond();
    SpanElement spanForXml = Document.get().createSpanElement();
    spanForXml.setAttribute(WAVE_XML_ATTRIBUTE, xmlInRange);
    spanForXml.setAttribute(WAVE_ANNOTATIONS_ATTRIBUTE, annotations);
    spanForXml.setClassName(MAGIC_CLASSNAME);

    LOG.trace().log("original point: " + origStart);

    // NOTE(user): An extra span is required at the end for Safari, otherwise
    // the span with the metadata may get discarded.
    SpanElement trailingSpan = Document.get().createSpanElement();
    trailingSpan.setInnerHTML("&nbsp;");

    if (origEnd.isInTextNode()) {
      Text t = (Text) origEnd.getContainer();
      t.setData(t.getData().substring(0, origEnd.getTextOffset()));
      origEnd.getContainer().getParentElement().insertAfter(spanForXml, t);
      origEnd.getContainer().getParentElement().insertAfter(trailingSpan, spanForXml);
    } else {
      origEnd.getContainer().insertAfter(spanForXml, origEnd.getNodeAfter());
      origEnd.getContainer().insertAfter(trailingSpan, spanForXml);
    }


    Point<Node> newEnd =
      Point.<Node> inElement(spanForXml.getParentElement(), trailingSpan.getNextSibling());
    LOG.trace().log("new point: " + newEnd);
    LOG.trace().logPlainText("parent: " + spanForXml.getParentElement().getInnerHTML());
    assert newEnd.getNodeAfter() == null
        || newEnd.getNodeAfter().getParentElement() == newEnd.getContainer() : "inconsistent point";
    return new PointRange<Node>(origStart, newEnd);
View Full Code Here

      InputElement inputElem = Document.get().createCheckInputElement();
      inputElem.setClassName(CheckConstants.css.check());

      // Wrap in non-editable span- Firefox does not fire events for checkboxes
      // inside contentEditable region.
      SpanElement nonEditableSpan = Document.get().createSpanElement();
      DomHelper.setContentEditable(nonEditableSpan, false, false);
      nonEditableSpan.appendChild(inputElem);

      return nonEditableSpan;
    }
View Full Code Here

   * Create a diff annotation element
   * @param type The type of change it will be annotating
   * @return The newly created element
   */
  public Element createElement(DiffType type) {
    SpanElement element = Document.get().createSpanElement();
    element.setPropertyObject(DIFF_KEY, type);
    NodeManager.setTransparentBackref(element, this);

    // HACK(danilatos): Demo looms, no time for learning how to use resource bundle etc.
    // or adding accessors to stylebase
    switch (type) {
View Full Code Here

          eventTestLog.appendChild(Document.get().createBRElement());
        }

        private void addInfo(EventInfo info, String value) {
          SpanElement el = Document.get().createSpanElement();
          el.addClassName(info.className());
          el.setInnerText(value);
          eventTestLog.appendChild(Document.get().createTextNode(" " + info + ":"));
          eventTestLog.appendChild(el);
        }
      });
    }
View Full Code Here

      private void setName(String name) {
        getElement().setInnerText(", " + name);
      }

      private void showError(String message) {
        final SpanElement errorElement = getElement().appendChild(
            Document.get().createSpanElement());
        errorElement.setClassName("header-new-author-error");
        final Style errorStyle = errorElement.getStyle();
        errorStyle.setProperty("color", "#800");
        errorStyle.setProperty("paddingLeft", "2px");
        errorStyle.setProperty("fontSize", "80%");
        errorElement.setInnerText(message);
        addHandler(this, ClickEvent.getType());
        sinkEvents(Event.ONCLICK);
      }
View Full Code Here

/**
* Utility methods for creating Elements from an {@link ImageResource}.
*/
public class ImageResourceElementCreator {
  public static Element createElementFrom(ImageResource resource) {
    SpanElement img = DocumentExt.get().createSpanElement();
    String style = "url(" + resource.getURL() + ") no-repeat "
        + (-resource.getLeft() + "px ") + (-resource.getTop() + "px");
    img.getStyle().setProperty("background", style);
    img.getStyle().setPropertyPx("width", resource.getWidth());
    img.getStyle().setPropertyPx("height", resource.getHeight());
    img.getStyle().setDisplay(Display.INLINE_BLOCK);
    return img;
  }
View Full Code Here

    @Override
    protected Element createElement() {
      // Create all the Top level elements
      filterBar = DocumentExt.get().createDivWithClassName(css.filterBar());

      final SpanElement labelElem = filterBar.appendChild(DocumentExt.get().createSpanElement());
      showAbove = labelElem.appendChild(DocumentExt.get().createAnchorElement());
      labelText = labelElem.appendChild(DocumentExt.get().createTextNode(""));
      showBelow = labelElem.appendChild(DocumentExt.get().createAnchorElement());

      labelElem.setClassName(css.filterLabel());
      showAbove.setHref("javascript:void(0);");
      showBelow.setHref("javascript:void(0);");

      rowsAbove = DocumentExt.get().createDivElement();
      rowsBelow = DocumentExt.get().createDivElement();
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.SpanElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.