Package com.google.gwt.dom.client

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


  public void onRemove() {
    String id = map.getRasterContext().getId(this);

    // Remove the terms of use:
    Element element = DOM.getElementById(id + "-googleAddon");
    if (element != null) {
      Element parent = element.getParentElement();
      parent.removeChild(element);
    }

    // Remove the Google map too:
    element = DOM.getElementById(id);
    if (element != null) {
      Element parent = element.getParentElement();
      parent.removeChild(element);
    }

    googleMap = null;
  }
View Full Code Here


   * @param event
   *            The mouse event itself.
   * @return Returns the ID of the DOM element or null if something went wrong.
   */
  public static String getTargetId(DomEvent<?> event) {
    Element element = getTarget(event);
    if (element != null) {
      return element.getId();
    }
    return null;
  }
View Full Code Here

  public void onRemove() {
    String id = map.getRasterContext().getId(this);

    // Remove the terms of use:
    Element element = DOM.getElementById(id + "-googleAddon");
    if (element != null) {
      Element parent = element.getParentElement();
      parent.removeChild(element);
    }

    // Remove the Google map too:
    element = DOM.getElementById(id);
    if (element != null) {
      Element parent = element.getParentElement();
      parent.removeChild(element);
    }

    googleMap = null;
  }
View Full Code Here

    ShapeStyle style = new ShapeStyle();

    // Check the "fill" child-element:
    String filled = element.getAttribute("filled");
    if ("true".equals(filled)) {
      Element fill = element.getElementsByTagName("fill").getItem(0);
      style.setFillColor(fill.getAttribute("color"));
      style.setFillOpacity(Float.parseFloat(fill.getAttribute("opacity")));
    }

    // Check the "stroke" child-element:
    String stroked = element.getAttribute("stroked");
    if ("true".equals(stroked)) {
      Element stroke = element.getElementsByTagName("stroke").getItem(0);
      style.setFillColor(stroke.getAttribute("color"));
      style.setFillOpacity(Float.parseFloat(stroke.getAttribute("opacity")));
      style.setStrokeWidth(Integer.parseInt(stroke.getAttribute("strokeweight")));
    }
    return style;
  }
View Full Code Here

   */
  private static void applyShapeStyle(Element element, ShapeStyle style) {
    // First check the presence of the fill and stroke elements:
    NodeList<Element> fills = element.getElementsByTagName("fill");
    if (fills.getLength() == 0) {
      Element stroke = DOM.createElementNS(DOM.NS_VML, "stroke");
      element.appendChild(stroke);
      Element fill = DOM.createElementNS(DOM.NS_VML, "fill");
      element.appendChild(fill);
      fills = element.getElementsByTagName("fill");
    }

    // Then if fill-color then filled=true:
View Full Code Here

    }
    return null;
  }

  protected String getTargetId(MouseEvent<?> event) {
    Element element = getTarget(event);
    if (element != null) {
      return element.getId();
    }
    return null;
  }
View Full Code Here

        activateCurrentMenuItem(event.getNewPlace());
    }

    private void activateCurrentMenuItem(final Place currentPlace) {
        for (final MenuItem menuItem : menu.asList()) {
            final Element element = menuItem.getElement();
            if (element != null) {
                element.removeClassName(Constants.ACTIVE);
            }
        }
        final MenuItem currentMenuItem = findCurrentMenuItem(currentPlace);
        if (currentMenuItem != null) {
            setActive(currentMenuItem);
View Full Code Here

     * @param menuItem
     * @return
     */
    private void setActive(final MenuItem menuItem) {
        if (menuItem != null) {
            final Element element = menuItem.getElement();
            if (element != null) {
                element.addClassName(Constants.ACTIVE);
            }
            setActive(menuItem.getParent());
        }
    }
View Full Code Here

    }


    protected void showShell() {
        final Element loading = Document.get().getElementById("loading");
        loading.getParentElement().removeChild(loading);

        /* And show the user the shell */
        RootLayoutPanel.get().add(shell);
        RootLayoutPanel.get().getElement().setId("rootPanel");

        // remove gwt extra divs and place shell nodes directly into the document body,
        // (and hope for the best about xbrowser compatibility..)
        shell.getElement().setId("shell");
        final Element shellElement = Document.get().getElementById("shell");
        shellElement.removeFromParent();
        Document.get().getElementById("rootPanel").removeFromParent();

        Element shellChildElement = shellElement.getFirstChildElement();
        while (shellChildElement != null) {
            shellChildElement.removeFromParent();
            Document.get().getBody().appendChild(shellChildElement);
            shellChildElement = shellElement.getFirstChildElement();
        }

    }
View Full Code Here

        //
        signupParaElement.setInnerHTML(i18n.login_signup("#" + SignUpPlace.PREFIX + ":"));

        final HTMLPanel passwordHintHtml = new HTMLPanel(i18n.login_passwordHint());
        final NodeList<Element> anchors = passwordHintHtml.getElement().getElementsByTagName("a");
        final Element a = anchors.getItem(0);
        final Anchor link = new Anchor(a.getInnerHTML());
        link.getElement().setId("signUpLink");
        link.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(final ClickEvent event) {
                delegate.onPasswordHintClick();
            }
        });
        passwordHintHtml.addAndReplaceElement(link, a);
        try {// fails on dev mode..
            HTMLPanel.wrap(passwordHintParaElement).add(passwordHintHtml);
        } catch (final Throwable e) {
            e.printStackTrace();
        }

        final HTMLPanel passwordRecoveryParaHtml = new HTMLPanel(i18n.updatePassword_requestRecoveryTokenLink());
        final Element passwordRecoveryA = passwordRecoveryParaHtml.getElement().getElementsByTagName("a").getItem(0);
        final Anchor passwordRecoveryLink = new Anchor(passwordRecoveryA.getInnerHTML());
        passwordRecoveryLink.getElement().setId("requestRecoveryTokenLink");
        passwordRecoveryLink.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(final ClickEvent event) {
View Full Code Here

TOP

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

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.