Java 类javax.swing.event.TreeExpansionListener 实例源码

项目:jfrog-idea-plugin    文件:CollapseAllAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
    TreeExpansionListener treeExpansionListener = getIssuesTreeExpansionListener(myTree.getTreeExpansionListeners());

    if (treeExpansionListener != null) {
        myTree.removeTreeExpansionListener(treeExpansionListener);
    }

    for (int i = myTree.getRowCount() - 1; i >= 0; i--) {
        myTree.collapseRow(i);
    }

    if (treeExpansionListener != null) {
        myTree.addTreeExpansionListener(treeExpansionListener);
        treeExpansionListener.treeCollapsed(null);
    }
}
项目:jfrog-idea-plugin    文件:ExpandAllAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
    TreeExpansionListener treeExpansionListener = getIssuesTreeExpansionListener(myTree.getTreeExpansionListeners());

    if (treeExpansionListener != null) {
        myTree.removeTreeExpansionListener(treeExpansionListener);
    }

    for (int i = 0; i < myTree.getRowCount(); i++) {
        myTree.expandRow(i);
    }

    if (treeExpansionListener != null) {
        myTree.addTreeExpansionListener(treeExpansionListener);
        treeExpansionListener.treeExpanded(null);
    }
}
项目:TreeTable    文件:TreeTable.java   
private <T extends EventListener> void addListener(Class<T> cls, T l) {
    if (l == null)
        return;
    int count = listenerList.getListenerCount(cls);
    listenerList.add(cls, l);
    if (count == 0) {
        if (cls == TreeExpansionListener.class) {
            tree.addTreeExpansionListener(adapter);
        } else if (cls == TreeWillExpandListener.class) {
            tree.addTreeWillExpandListener(adapter);
        } else if (cls == TreeTableMouseListener.class) {
            hasTreeTableMouseListener = true;
        } else if (cls == TreeTableMouseMotionListener.class) {
            hasTreeTableMouseMotionListener = true;
        }
    }
}
项目:TreeTable    文件:TreeTable.java   
private <T extends EventListener> void removeListener(Class<T> cls, T l) {
    if (l == null)
        return;
    listenerList.remove(cls, l);
    int count = listenerList.getListenerCount(cls);
    if (count == 0) {
        if (cls == TreeExpansionListener.class) {
            tree.removeTreeExpansionListener(adapter);
        } else if (cls == TreeWillExpandListener.class) {
            tree.removeTreeWillExpandListener(adapter);
        } else if (cls == TreeTableMouseListener.class) {
            hasTreeTableMouseListener = false;
        } else if (cls == TreeTableMouseMotionListener.class) {
            hasTreeTableMouseMotionListener = false;
        }
    }
}
项目:incubator-netbeans    文件:TreePathSupport.java   
private void fireTreeExpansion (TreeExpansionEvent e, boolean expanded) {
    int size = eListeners.size();

    TreeExpansionListener[] listeners = new TreeExpansionListener[size];
    synchronized (this) {
        listeners = eListeners.toArray(listeners);
    }
    for (int i=0; i < listeners.length; i++) {
        if (expanded) {
            listeners[i].treeExpanded(e);
        } else {
            listeners[i].treeCollapsed(e);
        }
    }
}
项目:jfrog-idea-plugin    文件:Utils.java   
public static TreeExpansionListener getIssuesTreeExpansionListener(TreeExpansionListener[] treeExpansionListeners) {
    if (treeExpansionListeners == null) {
        return null;
    }
    for (TreeExpansionListener treeExpansionListener : treeExpansionListeners) {
        if (treeExpansionListener instanceof IssuesTreeExpansionListener) {
            return treeExpansionListener;
        }
    }
    return null;
}
项目:openjdk-jdk10    文件:JTreeOperator.java   
/**
 * Maps {@code JTree.addTreeExpansionListener(TreeExpansionListener)}
 * through queue
 */
public void addTreeExpansionListener(final TreeExpansionListener treeExpansionListener) {
    runMapping(new MapVoidAction("addTreeExpansionListener") {
        @Override
        public void map() {
            ((JTree) getSource()).addTreeExpansionListener(treeExpansionListener);
        }
    });
}
项目:openjdk-jdk10    文件:JTreeOperator.java   
/**
 * Maps
 * {@code JTree.removeTreeExpansionListener(TreeExpansionListener)}
 * through queue
 */
public void removeTreeExpansionListener(final TreeExpansionListener treeExpansionListener) {
    runMapping(new MapVoidAction("removeTreeExpansionListener") {
        @Override
        public void map() {
            ((JTree) getSource()).removeTreeExpansionListener(treeExpansionListener);
        }
    });
}
项目:openjdk9    文件:JTreeOperator.java   
/**
 * Maps {@code JTree.addTreeExpansionListener(TreeExpansionListener)}
 * through queue
 */
public void addTreeExpansionListener(final TreeExpansionListener treeExpansionListener) {
    runMapping(new MapVoidAction("addTreeExpansionListener") {
        @Override
        public void map() {
            ((JTree) getSource()).addTreeExpansionListener(treeExpansionListener);
        }
    });
}
项目:openjdk9    文件:JTreeOperator.java   
/**
 * Maps
 * {@code JTree.removeTreeExpansionListener(TreeExpansionListener)}
 * through queue
 */
public void removeTreeExpansionListener(final TreeExpansionListener treeExpansionListener) {
    runMapping(new MapVoidAction("removeTreeExpansionListener") {
        @Override
        public void map() {
            ((JTree) getSource()).removeTreeExpansionListener(treeExpansionListener);
        }
    });
}
项目:javify    文件:JTree.java   
/**
 * Notifies all listeners that the tree was collapsed.
 *
 * @param path the path to the node that was collapsed
 */
public void fireTreeCollapsed(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeCollapsed(event);
}
项目:javify    文件:JTree.java   
/**
 * Notifies all listeners that the tree was expanded.
 *
 * @param path the path to the node that was expanded
 */
public void fireTreeExpanded(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeExpanded(event);
}
项目:jvm-stm    文件:JTree.java   
/**
 * Notifies all listeners that the tree was collapsed.
 * 
 * @param path the path to the node that was collapsed
 */
public void fireTreeCollapsed(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeCollapsed(event);
}
项目:jvm-stm    文件:JTree.java   
/**
 * Notifies all listeners that the tree was expanded.
 * 
 * @param path the path to the node that was expanded
 */
public void fireTreeExpanded(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeExpanded(event);
}
项目:swingx    文件:TreeExpansionBroadcaster.java   
/**
 * @param event
 */
private void fireTreeExpanded(TreeExpansionEvent event) {
    TreeExpansionListener[] ls = listeners
            .getListeners(TreeExpansionListener.class);
    for (int i = ls.length - 1; i >= 0; i--) {
        ls[i].treeExpanded(event);
    }
}
项目:swingx    文件:TreeExpansionBroadcaster.java   
/**
 * @param event
 */
private void fireTreeCollapsed(TreeExpansionEvent event) {
    TreeExpansionListener[] ls = listeners
            .getListeners(TreeExpansionListener.class);
    for (int i = ls.length - 1; i >= 0; i--) {
        ls[i].treeCollapsed(event);
    }
}
项目:cn1    文件:JTree.java   
public void fireTreeExpanded(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeExpanded(event);
    }
}
项目:cn1    文件:JTree.java   
public void fireTreeCollapsed(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeCollapsed(event);
    }
}
项目:JamVM-PH    文件:JTree.java   
/**
 * Notifies all listeners that the tree was collapsed.
 * 
 * @param path the path to the node that was collapsed
 */
public void fireTreeCollapsed(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeCollapsed(event);
}
项目:JamVM-PH    文件:JTree.java   
/**
 * Notifies all listeners that the tree was expanded.
 * 
 * @param path the path to the node that was expanded
 */
public void fireTreeExpanded(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeExpanded(event);
}
项目:classpath    文件:JTree.java   
/**
 * Notifies all listeners that the tree was collapsed.
 *
 * @param path the path to the node that was collapsed
 */
public void fireTreeCollapsed(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeCollapsed(event);
}
项目:classpath    文件:JTree.java   
/**
 * Notifies all listeners that the tree was expanded.
 *
 * @param path the path to the node that was expanded
 */
public void fireTreeExpanded(TreePath path)
{
  TreeExpansionEvent event = new TreeExpansionEvent(this, path);
  TreeExpansionListener[] listeners = getTreeExpansionListeners();

  for (int index = 0; index < listeners.length; ++index)
    listeners[index].treeExpanded(event);
}
项目:freeVM    文件:JTree.java   
public void fireTreeExpanded(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeExpanded(event);
    }
}
项目:freeVM    文件:JTree.java   
public void fireTreeCollapsed(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeCollapsed(event);
    }
}
项目:freeVM    文件:JTree.java   
public void fireTreeExpanded(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeExpanded(event);
    }
}
项目:freeVM    文件:JTree.java   
public void fireTreeCollapsed(TreePath path) {
    TreeExpansionListener[] listeners = getTreeExpansionListeners();
    if (listeners.length == 0) {
        return;
    }
    TreeExpansionEvent event = new TreeExpansionEvent(this, path);
    for (TreeExpansionListener element : listeners) {
        element.treeCollapsed(event);
    }
}
项目:TreeTable    文件:TreeTable.java   
public void setUI(TreeTableUI ui) {
        boolean addExpandLis = false;
        boolean addWillExpandLis = false;
        if (table != null) {
            table.removePropertyChangeListener(adapter);
            tree.removePropertyChangeListener(adapter);
            int lisCount = listenerList.getListenerCount(TreeExpansionListener.class);
            if (lisCount > 0) {
                tree.removeTreeExpansionListener(adapter);
                addExpandLis = true;
            }
            lisCount = listenerList.getListenerCount(TreeWillExpandListener.class);
            if (lisCount > 0) {
                tree.removeTreeWillExpandListener(adapter);
                addWillExpandLis = true;
            }
            getSelectionModel().removeTreeSelectionListener(adapter);
            if (getAutoCreateColumnsFromModel())
                columnModel = null;
            updateUIProperties();
        }
        super.setUI(ui);
        tree = getUI().getTreeInterface(this);
        table = getUI().getTableInterface(this);
//      if (columnModel == null) {
//          columnModel = table.getColumnModel();
//          int hc = getTreeColumnModel().getHierarchicalColumn();
//          if (hc >= 0)
//              columnModel.getColumn(hc).setPreferredWidth(150);
//      }
        getSelectionModel().addTreeSelectionListener(adapter);
        table.addPropertyChangeListener(adapter);
        tree.addPropertyChangeListener(adapter);
        if (addExpandLis)
            tree.addTreeExpansionListener(adapter);
        if (addWillExpandLis)
            tree.addTreeWillExpandListener(adapter);
        if (getAutoCreateColumnHeader() && isDisplayable())
            configureEnclosingScrollPane();
    }
项目:TreeTable    文件:TreeTable.java   
private void fireTreeExpansionEvent(TreePath path, boolean exp) {
    TreeExpansionEvent e = new TreeExpansionEvent(this, path);
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==TreeExpansionListener.class) {
            TreeExpansionListener lis = (TreeExpansionListener)listeners[i+1];
            if (exp) {
                lis.treeExpanded(e);
            } else {
                lis.treeCollapsed(e);
            }
        }
    }
}
项目:incubator-netbeans    文件:OutlineView.java   
public void addTreeExpansionListener( TreeExpansionListener l ) {
    TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport();
    if( tps != null )
        tps.addTreeExpansionListener(l);
}
项目:incubator-netbeans    文件:OutlineView.java   
public void removeTreeExpansionListener( TreeExpansionListener l ) {
    TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport();
    if( tps != null )
        tps.removeTreeExpansionListener(l);
}
项目:incubator-netbeans    文件:BrowserPanel.java   
void addTreeExpansionListener(TreeExpansionListener l) {
    outlineView.addTreeExpansionListener(l);
}
项目:incubator-netbeans    文件:BrowserPanel.java   
void removeTreeExpansionListener(TreeExpansionListener l) {
    outlineView.removeTreeExpansionListener(l);
}
项目:incubator-netbeans    文件:DebugTreeView.java   
public void addTreeExpansionListener(TreeExpansionListener listener) {
    tree.addTreeExpansionListener(listener);
}
项目:incubator-netbeans    文件:DebugTreeView.java   
public void removeTreeExpansionListener(TreeExpansionListener listener) {
    tree.removeTreeExpansionListener(listener);
}
项目:taxonaut    文件:AlignerTree.java   
public void addTreeExpansionListener(TreeExpansionListener listener)
   {
super.addTreeExpansionListener(listener);
   }
项目:j2se_for_android    文件:JTree.java   
public void addTreeExpansionListener(TreeExpansionListener tel) {
    list.add(TreeExpansionListener.class, tel);
}
项目:j2se_for_android    文件:JTree.java   
public void removeTreeExpansionListener(TreeExpansionListener tel) {
    list.remove(TreeExpansionListener.class, tel);
}
项目:j2se_for_android    文件:JTree.java   
public TreeExpansionListener[] getTreeExpansionListeners() {
    return list.getListeners(TreeExpansionListener.class);
}
项目:swingx    文件:JXTreeTable.java   
/**
 * Removes a listener for <code>TreeExpansion</code> events.
 * @param tel the <code>TreeExpansionListener</code> to remove
 */
public void removeTreeExpansionListener(TreeExpansionListener tel) {
    if (treeExpansionBroadcaster == null) return;
    treeExpansionBroadcaster.removeTreeExpansionListener(tel);
}
项目:swingx    文件:TreeExpansionBroadcaster.java   
public void addTreeExpansionListener(TreeExpansionListener l) {
    getEventListenerList().add(TreeExpansionListener.class, l);
}