Java 类javax.swing.event.TreeWillExpandListener 实例源码
项目: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 fireTreeWillExpand (TreeExpansionEvent e, boolean expanded) throws ExpandVetoException {
int size = weListeners.size();
TreeWillExpandListener[] listeners = new TreeWillExpandListener[size];
synchronized (this) {
listeners = weListeners.toArray(listeners);
}
for (int i=0; i < listeners.length; i++) {
if (expanded) {
listeners[i].treeWillExpand(e);
} else {
listeners[i].treeWillCollapse(e);
}
}
}
项目:incubator-netbeans
文件:TreePathSupport.java
private void fireTreeExpansionVetoed (TreeExpansionEvent e, ExpandVetoException ex) {
int size = weListeners.size();
TreeWillExpandListener[] listeners = new TreeWillExpandListener[size];
synchronized (this) {
listeners = weListeners.toArray(listeners);
}
for (int i=0; i < listeners.length; i++) {
if (listeners[i] instanceof ExtTreeWillExpandListener) {
((ExtTreeWillExpandListener) listeners[i]).treeExpansionVetoed(e,
ex);
}
}
}
项目:openjdk-jdk10
文件:JTreeOperator.java
/**
* Maps {@code JTree.addTreeWillExpandListener(TreeWillExpandListener)}
* through queue
*/
public void addTreeWillExpandListener(final TreeWillExpandListener treeWillExpandListener) {
runMapping(new MapVoidAction("addTreeWillExpandListener") {
@Override
public void map() {
((JTree) getSource()).addTreeWillExpandListener(treeWillExpandListener);
}
});
}
项目:openjdk-jdk10
文件:JTreeOperator.java
/**
* Maps
* {@code JTree.removeTreeWillExpandListener(TreeWillExpandListener)}
* through queue
*/
public void removeTreeWillExpandListener(final TreeWillExpandListener treeWillExpandListener) {
runMapping(new MapVoidAction("removeTreeWillExpandListener") {
@Override
public void map() {
((JTree) getSource()).removeTreeWillExpandListener(treeWillExpandListener);
}
});
}
项目:openjdk9
文件:JTreeOperator.java
/**
* Maps {@code JTree.addTreeWillExpandListener(TreeWillExpandListener)}
* through queue
*/
public void addTreeWillExpandListener(final TreeWillExpandListener treeWillExpandListener) {
runMapping(new MapVoidAction("addTreeWillExpandListener") {
@Override
public void map() {
((JTree) getSource()).addTreeWillExpandListener(treeWillExpandListener);
}
});
}
项目:openjdk9
文件:JTreeOperator.java
/**
* Maps
* {@code JTree.removeTreeWillExpandListener(TreeWillExpandListener)}
* through queue
*/
public void removeTreeWillExpandListener(final TreeWillExpandListener treeWillExpandListener) {
runMapping(new MapVoidAction("removeTreeWillExpandListener") {
@Override
public void map() {
((JTree) getSource()).removeTreeWillExpandListener(treeWillExpandListener);
}
});
}
项目:javify
文件:JTree.java
/**
* Notifies all listeners that the tree will collapse.
*
* @param path the path to the node that will collapse
*/
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillCollapse(event);
}
项目:javify
文件:JTree.java
/**
* Notifies all listeners that the tree will expand.
*
* @param path the path to the node that will expand
*/
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillExpand(event);
}
项目:project-argon
文件:RefreshTreeAction.java
@Override
public void actionPerformed(ActionEvent e) {
TreePath rootPath = new TreePath(model.getRoot());
DummyNode dummyTree = new DummyNode(rootPath.getPathComponent(0).toString(),
tree.isExpanded(rootPath));
buildDummyTree(dummyTree, rootPath);
// cannot determine listener in constructor because it's not initialized yet
TreeListener listener = (TreeListener) tree.getListeners(TreeWillExpandListener.class)[0];
listener.setShowErrorMessages(false);
expandTree(dummyTree, rootPath);
listener.setShowErrorMessages(true);
}
项目:jvm-stm
文件:JTree.java
/**
* Notifies all listeners that the tree will collapse.
*
* @param path the path to the node that will collapse
*/
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillCollapse(event);
}
项目:jvm-stm
文件:JTree.java
/**
* Notifies all listeners that the tree will expand.
*
* @param path the path to the node that will expand
*/
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillExpand(event);
}
项目:cn1
文件:JTree.java
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillExpand(event);
}
}
项目:cn1
文件:JTree.java
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillCollapse(event);
}
}
项目:JamVM-PH
文件:JTree.java
/**
* Notifies all listeners that the tree will collapse.
*
* @param path the path to the node that will collapse
*/
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillCollapse(event);
}
项目:JamVM-PH
文件:JTree.java
/**
* Notifies all listeners that the tree will expand.
*
* @param path the path to the node that will expand
*/
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillExpand(event);
}
项目:classpath
文件:JTree.java
/**
* Notifies all listeners that the tree will collapse.
*
* @param path the path to the node that will collapse
*/
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillCollapse(event);
}
项目:classpath
文件:JTree.java
/**
* Notifies all listeners that the tree will expand.
*
* @param path the path to the node that will expand
*/
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException
{
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
for (int index = 0; index < listeners.length; ++index)
listeners[index].treeWillExpand(event);
}
项目:freeVM
文件:JTree.java
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillExpand(event);
}
}
项目:freeVM
文件:JTree.java
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillCollapse(event);
}
}
项目:freeVM
文件:JTree.java
public void fireTreeWillExpand(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillExpand(event);
}
}
项目:freeVM
文件:JTree.java
public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException {
TreeWillExpandListener[] listeners = getTreeWillExpandListeners();
if (listeners.length == 0) {
return;
}
TreeExpansionEvent event = new TreeExpansionEvent(this, path);
for (TreeWillExpandListener element : listeners) {
element.treeWillCollapse(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 fireTreeWillExpandEvent(TreePath path, boolean exp) throws ExpandVetoException {
TreeExpansionEvent e = new TreeExpansionEvent(this, path);
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==TreeWillExpandListener.class) {
TreeWillExpandListener lis = (TreeWillExpandListener)listeners[i+1];
if (exp) {
lis.treeWillExpand(e);
} else {
lis.treeWillCollapse(e);
}
}
}
}
项目:j2se_for_android
文件:JTree.java
public void addTreeWillExpandListener(TreeWillExpandListener tel) {
list.add(TreeWillExpandListener.class, tel);
}
项目:j2se_for_android
文件:JTree.java
public void removeTreeWillExpandListener(TreeWillExpandListener tel) {
list.remove(TreeWillExpandListener.class, tel);
}
项目:j2se_for_android
文件:JTree.java
public TreeWillExpandListener[] getTreeWillExpandListeners() {
return list.getListeners(TreeWillExpandListener.class);
}
项目:javify
文件:JTree.java
/**
* Returns all added <code>TreeWillExpandListener</code> objects.
*
* @return an array of listeners
*/
public TreeWillExpandListener[] getTreeWillExpandListeners()
{
return (TreeWillExpandListener[])
getListeners(TreeWillExpandListener.class);
}
项目:jvm-stm
文件:JTree.java
/**
* Returns all added <code>TreeWillExpandListener</code> objects.
*
* @return an array of listeners
*/
public TreeWillExpandListener[] getTreeWillExpandListeners()
{
return (TreeWillExpandListener[])
getListeners(TreeWillExpandListener.class);
}
项目:cn1
文件:JTree.java
public void addTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.add(TreeWillExpandListener.class, l);
}
项目:cn1
文件:JTree.java
public void removeTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.remove(TreeWillExpandListener.class, l);
}
项目:cn1
文件:JTree.java
public TreeWillExpandListener[] getTreeWillExpandListeners() {
return listenerList.getListeners(TreeWillExpandListener.class);
}
项目:JamVM-PH
文件:JTree.java
/**
* Returns all added <code>TreeWillExpandListener</code> objects.
*
* @return an array of listeners
*/
public TreeWillExpandListener[] getTreeWillExpandListeners()
{
return (TreeWillExpandListener[])
getListeners(TreeWillExpandListener.class);
}
项目:classpath
文件:JTree.java
/**
* Returns all added <code>TreeWillExpandListener</code> objects.
*
* @return an array of listeners
*/
public TreeWillExpandListener[] getTreeWillExpandListeners()
{
return (TreeWillExpandListener[])
getListeners(TreeWillExpandListener.class);
}
项目:freeVM
文件:JTree.java
public void addTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.add(TreeWillExpandListener.class, l);
}
项目:freeVM
文件:JTree.java
public void removeTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.remove(TreeWillExpandListener.class, l);
}
项目:freeVM
文件:JTree.java
public TreeWillExpandListener[] getTreeWillExpandListeners() {
return listenerList.getListeners(TreeWillExpandListener.class);
}
项目:freeVM
文件:JTree.java
public void addTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.add(TreeWillExpandListener.class, l);
}
项目:freeVM
文件:JTree.java
public void removeTreeWillExpandListener(TreeWillExpandListener l) {
listenerList.remove(TreeWillExpandListener.class, l);
}