Example usage for javax.swing JTree getName

List of usage examples for javax.swing JTree getName

Introduction

In this page you can find the example usage for javax.swing JTree getName.

Prototype

public String getName() 

Source Link

Document

Gets the name of the component.

Usage

From source file:org.kepler.objectmanager.library.LibraryManager.java

/**
 * Add a reference to a JTree that is using the Library Tree Model so that
 * it can be updated when the tree model changes. Whenever getTreeModel() is
 * used in a gui component, the JTree reference should be added using this
 * method so that it can get refreshed when the library model changes using
 * the refreshJTrees() method./*from  w ww .  jav a  2s. c o  m*/
 * 
 *@param ptree
 *            The feature to be added to the LibraryComponent attribute
 */
public void addLibraryJTree(JTree ptree) {
    if (isDebugging) {
        log.debug("addLibraryComponent(" + ptree.getName() + ")");
    }
    if (isDebugging)
        log.debug("addLibraryComponent(" + ptree + ")");
    WeakReference<JTree> ptreeWR = new WeakReference<JTree>(ptree);
    _trees.addElement(ptreeWR);
    if (isDebugging)
        log.debug("_trees size:" + _trees.size());

    // add this tree to the map and register for expansion events
    _treeExpansionMap.put(ptree, new LinkedList<TreePath>());
    ptree.addTreeExpansionListener(this);
}

From source file:org.zaproxy.zap.extension.brk.PopupMenuAddBreakSites.java

private JTree getTree(Component invoker) {
    if (invoker instanceof JTree) {
        JTree tree = (JTree) invoker;
        if (tree.getName().equals("treeSite")) {
            return tree;
        }/*from   w  w  w . j  a  v a 2  s . c  om*/
    }

    return null;
}