Package com.extjs.gxt.ui.client.event

Examples of com.extjs.gxt.ui.client.event.TreeEvent


   *
   * @param item the item to be added
   * @param index index at which the specified element is to be inserted
   */
  public void add(TreeItem item, int index) {
    TreeEvent te = new TreeEvent(tree);
    te.setParent(this);
    te.setItem(item);
    te.setIndex(index);
    if (fireEvent(Events.BeforeAdd, te)) {
      if (item.parentItem != null && item.parentItem != this) {
        item.parentItem.remove(item);
      } else if (item.parentItem != null && item.parentItem == parentItem) {
        children.remove(item);
View Full Code Here


   */
  public void remove(TreeItem item) {
    if (!children.contains(item)) {
      return;
    }
    TreeEvent te = new TreeEvent(tree);
    te.setParent(this);
    te.setItem(item);
    if (fireEvent(Events.BeforeRemove, te)) {
      children.remove(item);
      tree.unregisterItem(item);

      item.tree = null;
View Full Code Here

   * @param checked <code>true</code> to check
   */
  public void setChecked(boolean checked) {
    this.checked = checked;
    if (rendered) {
      if (fireEvent(Events.BeforeCheckChange, new TreeEvent(tree, this))) {
        ui.onCheckChange(checked);
        if (checked) {
          switch (tree.getCheckStyle()) {
            case PARENTS:
              TreeItem p = getParentItem();
View Full Code Here

      this.expanded = false;
    } else if (!expanded && root) {
      this.expanded = true;
    }

    TreeEvent te = new TreeEvent(tree, this);

    if (expanded) {
      if (!this.expanded && !isLeaf()) {
        if (fireEvent(Events.BeforeExpand, te)) {
          this.expanded = true;
View Full Code Here

  }

  public void onCheckChange(boolean checked) {
    String cls = checked ? styleTreeChecked : styleTreeNotChecked;
    checkDivEl.setClassName(cls);
    item.fireEvent(Events.CheckChange, new TreeEvent(item.tree, item));
  }
View Full Code Here

    fly(itemEl).removeStyleName(styleTreeJointOver);
    if (GXT.isFocusManagerEnabled()) {
      Accessibility.setState(item.getElement(), "aria-expanded", "false");
      FocusFrame.get().sync(item.tree);
    }
    item.fireEvent(Events.Collapse, new TreeEvent(item.tree, item));
  }
View Full Code Here

    fly(itemEl).removeStyleName(styleTreeJointOver);
    if (GXT.isFocusManagerEnabled()) {
      Accessibility.setState(item.getElement(), "aria-expanded", "true");
      FocusFrame.get().sync(item.tree);
    }
    item.fireEvent(Events.Expand, new TreeEvent(item.tree, item));
  }
View Full Code Here

  }

  @Override
  public void onComponentEvent(ComponentEvent ce) {
    super.onComponentEvent(ce);
    TreeEvent te = (TreeEvent) ce;
    if (te.getItem() != null) {
      te.getItem().onComponentEvent(te);
    }

    int type = ce.getEventTypeInt();
    switch (type) {
      case Event.ONFOCUS:
View Full Code Here

    this.treeItemPartId = treeItemPartId;
  }

  @Override
  protected ComponentEvent createComponentEvent(Event event) {
    return new TreeEvent(this, event == null ? null : findItem(DOM.eventGetTarget(event)));
  }
View Full Code Here

  }

  @SuppressWarnings("rawtypes")
  @Override
  protected ContainerEvent createContainerEvent(TreeItem item) {
    return new TreeEvent(this, item);
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.event.TreeEvent

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.