Package elemental.html

Examples of elemental.html.Element


        // We might have set the CSS to say it is closed, but the animation
        // takes a little while. As such, we check to make sure the children
        // container is set to display:none before trying to dispatch an open.
        // Otherwise we can get into an inconsistent state if we click really
        // fast.
        Element childrenContainer = treeNode.getChildrenContainer();
        if (childrenContainer != null && !CssUtils.isVisible(childrenContainer)) {
          getDelegate().onNodeExpanded(treeNode);
        }
      }
    }
View Full Code Here


        if (getDelegate() == null || (primaryMouseButtonOnly
            && ((MouseEvent) evt).getButton() != MouseEvent.Button.PRIMARY)) {
          return;
        }

        Element eventTarget = (Element) evt.getTarget();

        if (CssUtils.containsClassName(eventTarget, css.expandControl())) {
          onExpansionControlEvent(evt, eventTarget);
        } else {
          Element treeNodeBody =
              CssUtils.getAncestorOrSelfWithClassName(eventTarget, css.treeNodeBody());
          if (treeNodeBody != null) {
           
            if (Event.CLICK.equals(evt.getType())) {
              double currentClickMs = Duration.currentTimeMillis();
              if (currentClickMs - previousClickMs < MouseGestureListener.MAX_CLICK_TIMEOUT_MS
                  && treeNodeBody.equals(previousClickTreeNodeBody)) {
                // Swallow double, triple, etc. clicks on an item's label
                return;
              } else {
                this.previousClickMs = currentClickMs;
                this.previousClickTreeNodeBody = treeNodeBody;
View Full Code Here

    // If we are already mutating, return.
    if (isMutating()) {
      return;
    }

    Element element = callback.getElementForMutation(node);
    if (element == null) {
      return;
    }

    String oldLabel = element.getTextContent();
    callback.onBeforeMutation(node);

    // Make a temporary text input box to grab user input, and place it inside
    // the label element.
    InputElement input = Elements.createInputElement();
    if (css != null) {
      input.setClassName(css.nodeNameInput());
    }
    input.setType("text");
    input.setValue(oldLabel);

    // Wipe the content from the element.
    element.setTextContent("");

    // Attach the temporary input box.
    element.appendChild(input);
    input.focus();
    input.select();

    // If we hit enter, commit the action.
    input.addEventListener(Event.KEYUP, keyListener, false);
View Full Code Here

      breakpointsPane = createBreakpointsPane();
      domInspectorPane = createDomInspectorPane();
      consolePane = createConsolePane();
      noApiPane = noApiPaneView.getElement();

      Element rootElement = Elements.createDivElement(css.root());

      Element unscrollable = Elements.createDivElement(css.unscrollable());
      unscrollable.appendChild(headerPane);
      unscrollable.appendChild(controlsPane);
      unscrollable.appendChild(noApiPane);

      Element scrollable = Elements.createDivElement(css.scrollable());
      scrollable.appendChild(watchExpressionsPane);
      scrollable.appendChild(callStackPane);
      scrollable.appendChild(scopeVariablesPane);
      scrollable.appendChild(breakpointsPane);
      scrollable.appendChild(consolePane);
      scrollable.appendChild(domInspectorPane);

      rootElement.appendChild(unscrollable);
      rootElement.appendChild(scrollable);
      setElement(rootElement);
View Full Code Here

      return createExpandablePane("Console", "Not debugging", "", consoleView.getElement());
    }

    private Element createExpandablePane(String titleText, String infoHeader, String infoBody,
        Element dataElement) {
      Element pane = Elements.createDivElement(css.expandablePane());

      Element title = Elements.createDivElement(css.paneTitle());
      DomUtils.appendDivWithTextContent(title, css.paneTitleText(), titleText);
      title.addEventListener(Event.CLICK, expandCollapsePaneListener, false);

      Element info = Elements.createDivElement(css.paneInfo());
      if (!StringUtils.isNullOrEmpty(infoHeader)) {
        DomUtils.appendDivWithTextContent(info, css.paneInfoHeader(), infoHeader);
      }
      if (!StringUtils.isNullOrEmpty(infoBody)) {
        DomUtils.appendDivWithTextContent(info, css.paneInfoBody(), infoBody);
      }

      Element data = Elements.createDivElement(css.paneData());
      if (dataElement != null) {
        data.appendChild(dataElement);
      }

      Element body = Elements.createDivElement(css.paneBody());
      body.appendChild(info);
      body.appendChild(data);

      pane.appendChild(title);
      pane.appendChild(body);
      return pane;
    }
View Full Code Here

    private Element getPaneTitle(Element pane) {
      return DomUtils.getFirstElementByClassName(pane, css.paneTitle());
    }

    private void showPaneData(Element pane, boolean show) {
      Element info = DomUtils.getFirstElementByClassName(pane, css.paneInfo());
      Element data = DomUtils.getFirstElementByClassName(pane, css.paneData());
      CssUtils.setDisplayVisibility(info, !show);
      CssUtils.setDisplayVisibility(data, show);
    }
View Full Code Here

      splitter = Elements.createDivElement(css.splitter());

      rightSplitter = Elements.createDivElement(css.rightSplitter());
      rightSidebarContentContainer = Elements.createDivElement(css.rightSidebarContentContainer());

      Element elem = getElement();
      navArea.appendChild(navView.getElement());
      elem.appendChild(navArea);
      elem.appendChild(splitter);
      elem.appendChild(contentView.getElement());

      // Attach the right sidebar and splitter to the base element of the
      // WorkspaceContentArea.View.
      contentView.getElement().appendChild(rightSplitter);
      contentView.getElement().appendChild(rightSidebarContentContainer);
View Full Code Here

  public void cleanup() {
    hide();
  }
 
  private static Element createPopupDummyElement(int lineHeight) {
    Element element = Elements.createDivElement();

    CSSStyleDeclaration style = element.getStyle();
    style.setDisplay(CSSStyleDeclaration.Display.INLINE_BLOCK);
    style.setPosition(CSSStyleDeclaration.Position.ABSOLUTE);
    style.setWidth(0, CSSStyleDeclaration.Unit.PX);
    style.setHeight(lineHeight, CSSStyleDeclaration.Unit.PX);
    style.setZIndex(1);
View Full Code Here

  private void setPopupPartnersEnabled(@Nullable JsonArray<Element> partnerElements,
      boolean enable) {
    if (partnerElements != null) {
      for (int i = 0, n = partnerElements.size(); i < n; ++i) {
        Element element = partnerElements.get(i);
        if (enable) {
          popup.addPartner(element);
          popup.addPartnerClickTargets(element);
        } else {
          popup.removePartner(element);
View Full Code Here

      private Element breadcrumb;
      private final Css css;

      View(Resources res, String name, String iconClass) {
        css = res.workspaceLocationBreadcrumbsCss();
        Element breadcrumbSlash = Elements.createSpanElement(css.breadcrumbSlash());
        breadcrumbSlash.setTextContent("/");

        breadcrumb = Elements.createSpanElement(css.breadcrumb());
        breadcrumb.addClassName(iconClass);
        breadcrumb.setTextContent(name);

        Element breadcrumbWrap = Elements.createSpanElement(css.breadcrumbWrap());
        breadcrumbWrap.appendChild(breadcrumbSlash);
        breadcrumbWrap.appendChild(breadcrumb);

        // Start hidden
        breadcrumb.addClassName(css.start());
        setElement(breadcrumbWrap);
      }
View Full Code Here

TOP

Related Classes of elemental.html.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.