[Mc4j-cvs] mc4j/src/org/mc4j/console/install ExplorerUtil.java,1.8,1.9
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2004-03-31 03:27:49
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25123/src/org/mc4j/console/install Modified Files: ExplorerUtil.java Log Message: Added check to see if a node isSelected. (There doesn't seem to be a way to see if a node's properties are visible) Index: ExplorerUtil.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/install/ExplorerUtil.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExplorerUtil.java 19 Feb 2004 19:31:42 -0000 1.8 --- ExplorerUtil.java 31 Mar 2004 03:16:04 -0000 1.9 *************** *** 23,34 **** import org.openide.ErrorManager; - import org.openide.explorer.view.TreeView; - import org.openide.explorer.ExplorerPanel; import org.openide.nodes.Node; - import org.mc4j.console.swing.ExtendedExplorerPanel; import org.mc4j.console.ConnectionExplorer; /** * * @author Greg Hinkle (gh...@us...), August 2002 --- 23,32 ---- import org.openide.ErrorManager; import org.openide.nodes.Node; import org.mc4j.console.ConnectionExplorer; /** + * Useful utilities for dealing with the primary connection explorer tree. * * @author Greg Hinkle (gh...@us...), August 2002 *************** *** 57,60 **** --- 55,74 ---- } + /** + * + * @since MC4J 1.2b5 + * @param node any node to check if it is selected + * @return true if the node is selected in the primary explorer view + */ + public static boolean isSelected(Node node) { + Node[] selection = getExplorer().getExplorerManager().getSelectedNodes(); + for (int i = 0; i < selection.length; i++) { + Node selectedNode = selection[i]; + if (selectedNode.equals(node)) + return true; + } + return false; + } + public static boolean isExpanded(Node node) { return getExplorer().getBeanTreeView().isExpanded(node); |