當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。