Package com.google.gwt.dom.client

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


    assertSpanContainsRenderedValueText(RENDERED_VALUE_TWICE + RENDERED_VALUE_TWICE,
        spanNode2.getFirstChild());
  }

  public void testStyleManipulation() {
    SpanElement nameSpan = renderer.getNameSpan(docDiv);
    assertEquals(renderer.getUiStyle().enabled(), nameSpan.getClassName());
    nameSpan.replaceClassName(renderer.getUiStyle().enabled(),
        renderer.getUiStyle().disabled());
    assertEquals(renderer.getUiStyle().disabled(), nameSpan.getClassName());
  }
View Full Code Here


   * Create a span and attach it to the {@link RootPanel}.
   *
   * @return the new span
   */
  protected Element createAttachedSpanElement() {
    SpanElement elem = Document.get().createSpanElement();
    RootPanel.getBodyElement().appendChild(elem);
    return elem;
  }
View Full Code Here

 
  public void testToString() {
    UIObject u = new UIObject() {
    };
    assertEquals("(null handle)", u.toString());
    SpanElement span = Document.get().createSpanElement();
    u.setElement(span);
    assertEquals(span.getString(), u.toString());
  }
View Full Code Here

        }

        private SpanElement createSpanElement( final Cursor cursor,
                                               final double left,
                                               final double width ) {
            final SpanElement span = document.createSpanElement();
            span.setAttribute( "title",
                               title );
            final Style style = span.getStyle();
            style.setCursor( cursor );
            style.setPosition( Position.ABSOLUTE );
            style.setBottom( 0,
                             PX );
            style.setHeight( source.getOffsetHeight(),
View Full Code Here

   }

   @Test
   public void createSpan() {
      // Act
      SpanElement elem = SpanElement.as(DOM.createSpan());

      // Assert
      assertEquals("span", elem.getTagName());
   }
View Full Code Here

      DivElement child0 = (DivElement) parent1.getChild(0);
      assertEquals("child0", child0.getId());
      assertEquals(1, child0.getChildCount());

      SpanElement span = (SpanElement) child0.getChild(0);
      assertEquals("", span.getId());
      assertEquals("spanClass", span.getClassName());
      assertEquals(1, span.getChildCount());
      assertEquals(Node.TEXT_NODE, span.getChild(0).getNodeType());
      Text text = span.getChild(0).cast();
      assertEquals("test", text.getData());
      assertEquals("test", span.getInnerText());

      BRElement br = (BRElement) parent1.getChild(1);
      assertEquals("", br.getId());

      DivElement child2 = (DivElement) parent1.getChild(2);
View Full Code Here

      Label label = (Label) wrappedPanel.getWidget(1);
      assertNotNull(label);
      assertEquals("Keep your ducks", label.getText());

      SpanElement spanElement = Document.get().getElementById("mySpan").cast();
      assertEquals("some span for testing", spanElement.getInnerText());
      assertEquals("pretty", spanElement.getClassName());

      assertEquals("We strongly urge you to reconsider.", w.msgLabel.getText());

      assertEquals("9'00", w.msgInnerWidget.getText());
      assertEquals(w.msgInnerWidget, wrappedPanel.getWidget(5));
View Full Code Here

    private final String hoverImg;

    public RatingItem(int index, int orientation, String selectedImg,
        String deselectedImg, String hoverImg, int width, int height) {
      final SpanElement star = Document.get().createSpanElement();

      setElement(star);
      sinkEvents(Event.MOUSEEVENTS | Event.ONCLICK);
      this.index = index;
      this.deselectedImg = "url(" + deselectedImg + ")";
      this.selectedImg = "url(" + selectedImg + ")";
      this.hoverImg =
          "".equals(hoverImg) ? this.selectedImg : "url(" + hoverImg + ")";
      if ((orientation & (LTR | RTL)) > 0) {
        star.getStyle().setProperty(CSS.A.FLOAT, CSS.V.FLOAT.LEFT);
      }
      setStyleName("cbg-RatingItem");
      getElement().getStyle().setPropertyPx(CSS.A.WIDTH, width);
      getElement().getStyle().setPropertyPx(CSS.A.HEIGHT, height);
      star.getStyle().setPropertyPx(CSS.A.FONT_SIZE, 0);
      star.getStyle().setProperty(CSS.A.BACKGROUND_REPEAT,
          CSS.V.BACKGROUND_REPEAT.NO_REPEAT);
      star.getStyle().setProperty(CSS.A.DISPLAY, CSS.V.DISPLAY.BLOCK);
    }
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

*/
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

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.