Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.Element.cast()


        /*
         * Found the table section. Return the most recent cell element that we
         * discovered.
         */
        if (cur == tbody || cur == tfoot || cur == thead) {
          targetTableSection = cur.cast(); // We found the table section.
          if (maybeTableCell != null) {
            targetTableCell = maybeTableCell.cast();
            break;
          }
        }
View Full Code Here


      if (table.legacyRenderRowValues) {
        int count = 0;
        while (insertBefore != null && count < childCount) {
          Element next = insertBefore.getNextSiblingElement();
          section.removeChild(insertBefore);
          insertBefore = (next == null) ? null : next.<TableRowElement> cast();
          count++;
        }
      } else {
        while (insertBefore != null
            && table.tableBuilder.getRowValueIndex(insertBefore) < absEndIndex) {
View Full Code Here

      } else {
        while (insertBefore != null
            && table.tableBuilder.getRowValueIndex(insertBefore) < absEndIndex) {
          Element next = insertBefore.getNextSiblingElement();
          section.removeChild(insertBefore);
          insertBefore = (next == null) ? null : next.<TableRowElement> cast();
        }
      }

      // Add new child elements.
      TableSectionElement newSection = convertToSectionElement(table, section.getTagName(), html);
View Full Code Here

        }

        // Determine if we clicked on a checkbox.
        Element target = nativeEvent.getEventTarget().cast();
        if ("input".equals(StringCase.toLower(target.getTagName()))) {
          final InputElement input = target.cast();
          if ("checkbox".equals(StringCase.toLower(input.getType()))) {
            // Synchronize the checkbox with the current selection state.
            input.setChecked(event.getDisplay().getSelectionModel().isSelected(
                event.getValue()));
            return SelectAction.TOGGLE;
View Full Code Here

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    bufferRender(models, sb);

    Element d = DOM.createDiv();
    d.setInnerHTML(sb.toSafeHtml().asString());
    List<Element> list = appearance.findElements(d.<XElement> cast());

    final Element ref = index == 0 ? null : all.getElement(index - 1);
    final Element n = ref == null ? null : ref.getParentElement();

    for (int i = list.size() - 1; i >= 0; i--) {
View Full Code Here

        if (index != -1) {
          if (selectOnHover) {
            sm.select(index, false);
          } else {
            if (target != overElement) {
              appearance.onOver(target.<XElement> cast(), true);
              overElement = target.<XElement> cast();
            }
          }
        }
      }
View Full Code Here

          if (selectOnHover) {
            sm.select(index, false);
          } else {
            if (target != overElement) {
              appearance.onOver(target.<XElement> cast(), true);
              overElement = target.<XElement> cast();
            }
          }
        }
      }
    }
View Full Code Here

  protected void onRemove(M data, int index) {
    if (all != null) {
      Element e = getElement(index);
      if (e != null) {
        appearance.onOver(e.<XElement> cast(), false);
        if (overElement == e) {
          overElement = null;
        }

        getSelectionModel().deselect(index);
View Full Code Here

    cell.edit(context, parent, "originalValue");

    // Verify the input element.
    Element child = parent.getFirstChildElement();
    assertTrue(InputElement.is(child));
    InputElement input = child.cast();
    assertEquals("newValue", input.getValue());
  }

  /**
   * Cancel and switch to read only mode.
View Full Code Here

        "helloWorld", event, "editing", null, null, expectedViewData);

    // Verify the input element.
    Element child = parent.getFirstChildElement();
    assertTrue(InputElement.is(child));
    InputElement input = child.cast();
    assertEquals("editing", input.getValue());
  }

  /**
   * Test rendering the cell with a valid value and view data, but without
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.