当前位置: 首页>>代码示例>>Java>>正文


Java TreeExpansionListener类代码示例

本文整理汇总了Java中javax.swing.event.TreeExpansionListener的典型用法代码示例。如果您正苦于以下问题:Java TreeExpansionListener类的具体用法?Java TreeExpansionListener怎么用?Java TreeExpansionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TreeExpansionListener类属于javax.swing.event包,在下文中一共展示了TreeExpansionListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:18,代码来源:CollapseAllAction.java

示例2: actionPerformed

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:18,代码来源:ExpandAllAction.java

示例3: addListener

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
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;
        }
    }
}
 
开发者ID:Sciss,项目名称:TreeTable,代码行数:18,代码来源:TreeTable.java

示例4: removeListener

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
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;
        }
    }
}
 
开发者ID:Sciss,项目名称:TreeTable,代码行数:18,代码来源:TreeTable.java

示例5: fireTreeExpansion

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:TreePathSupport.java

示例6: getIssuesTreeExpansionListener

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
public static TreeExpansionListener getIssuesTreeExpansionListener(TreeExpansionListener[] treeExpansionListeners) {
    if (treeExpansionListeners == null) {
        return null;
    }
    for (TreeExpansionListener treeExpansionListener : treeExpansionListeners) {
        if (treeExpansionListener instanceof IssuesTreeExpansionListener) {
            return treeExpansionListener;
        }
    }
    return null;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:12,代码来源:Utils.java

示例7: addTreeExpansionListener

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:JTreeOperator.java

示例8: removeTreeExpansionListener

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JTreeOperator.java

示例9: fireTreeCollapsed

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:14,代码来源:JTree.java

示例10: fireTreeExpanded

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:14,代码来源:JTree.java

示例11: fireTreeCollapsed

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:14,代码来源:JTree.java

示例12: fireTreeExpanded

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:14,代码来源:JTree.java

示例13: fireTreeExpanded

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * @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);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:TreeExpansionBroadcaster.java

示例14: fireTreeCollapsed

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
/**
 * @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);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:TreeExpansionBroadcaster.java

示例15: fireTreeExpanded

import javax.swing.event.TreeExpansionListener; //导入依赖的package包/类
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);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:JTree.java


注:本文中的javax.swing.event.TreeExpansionListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。