本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
});
}
示例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);
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}