@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); } }
@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); } }
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; } } }
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; } } }
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); } } }
public static TreeExpansionListener getIssuesTreeExpansionListener(TreeExpansionListener[] treeExpansionListeners) { if (treeExpansionListeners == null) { return null; } for (TreeExpansionListener treeExpansionListener : treeExpansionListeners) { if (treeExpansionListener instanceof IssuesTreeExpansionListener) { return treeExpansionListener; } } return null; }
/** * 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); } }); }
/** * 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); } }); }
/** * 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); }
/** * 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); }
/** * @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); } }
/** * @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); } }
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); } }
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); } }
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(); }
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); } } } }
public void addTreeExpansionListener( TreeExpansionListener l ) { TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport(); if( tps != null ) tps.addTreeExpansionListener(l); }
public void removeTreeExpansionListener( TreeExpansionListener l ) { TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport(); if( tps != null ) tps.removeTreeExpansionListener(l); }
void addTreeExpansionListener(TreeExpansionListener l) { outlineView.addTreeExpansionListener(l); }
void removeTreeExpansionListener(TreeExpansionListener l) { outlineView.removeTreeExpansionListener(l); }
public void addTreeExpansionListener(TreeExpansionListener listener) { tree.addTreeExpansionListener(listener); }
public void removeTreeExpansionListener(TreeExpansionListener listener) { tree.removeTreeExpansionListener(listener); }
public void addTreeExpansionListener(TreeExpansionListener listener) { super.addTreeExpansionListener(listener); }
public void addTreeExpansionListener(TreeExpansionListener tel) { list.add(TreeExpansionListener.class, tel); }
public void removeTreeExpansionListener(TreeExpansionListener tel) { list.remove(TreeExpansionListener.class, tel); }
public TreeExpansionListener[] getTreeExpansionListeners() { return list.getListeners(TreeExpansionListener.class); }
/** * 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); }
public void addTreeExpansionListener(TreeExpansionListener l) { getEventListenerList().add(TreeExpansionListener.class, l); }