當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.addPropertyChangeListener方法代碼示例

本文整理匯總了Java中org.openide.nodes.Node.addPropertyChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.addPropertyChangeListener方法的具體用法?Java Node.addPropertyChangeListener怎麽用?Java Node.addPropertyChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.nodes.Node的用法示例。


在下文中一共展示了Node.addPropertyChangeListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getValueFor

import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
public Object getValueFor(Object node, int column) {
    Node n = Visualizer.findNode(node);
    if (n == null) {
        throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + node + " of class " + node.getClass().getName());
    }
    PropertyChangeListener cacheEntry = nodesListenersCache.get (n);
    if (cacheEntry == null) {
        PropertyChangeListener p = WeakListeners.propertyChange(pcl, n);
        nodesListenersCache.put(n, p);
        n.addPropertyChangeListener(p);
        NodeListener l = WeakListeners.create(NodeListener.class, nl, n);
        n.addNodeListener(l);
    }
    Node.Property theRealProperty = getPropertyFor(n, prop[column]);
    return theRealProperty;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:PropertiesRowModel.java

示例2: attach

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Attach to a node, detaching from the last one if non-null.  */
public void attach(Node n) {
    if (currNode != n) {
        if (currNode != null) {
            detach();
        }

        if (n != null) {
            n.addPropertyChangeListener(inner);
            n.addNodeListener(this);

            if (PropUtils.isLoggable(PropertySheet.class)) {
                PropUtils.log(PropertySheet.class, "Now listening for changes on " + n);
            }
        }

        currNode = n;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:PropertySheet.java

示例3: initializeWithRootContext

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Initialize this top component properly with information
* obtained from specified root context node */
private void initializeWithRootContext (Node rc) {
    // update TC's attributes
    setToolTipText(rc.getDisplayName());
    setName(rc.getDisplayName());
    updateTitle();
    // attach listener
    if (weakRcL == null) {
        weakRcL = WeakListeners.propertyChange(
            rcListener(), rc
        );
    }
    rc.addPropertyChangeListener(weakRcL);

    if (weakNRcL == null) {
        weakNRcL = NodeOp.weakNodeListener (
            rcListener(), rc
        );
    }
    rc.addNodeListener(weakNRcL);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:Tab.java

示例4: insertNode

import org.openide.nodes.Node; //導入方法依賴的package包/類
public void insertNode(Node node) {
    Node[] nodes;
    if(nodeRows == null) {
        nodes = new Node[1];
    } else {
        nodes = new Node[nodeRows.length + 1];
        System.arraycopy(nodeRows, 0, nodes, 0, nodeRows.length);
    }
    nodes[nodes.length - 1] = node;
    node.addPropertyChangeListener(pcl);
    nodeRows = nodes;
    fireTableDataChanged();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:NodeTableModel.java

示例5: IndexedEditorPanel

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Creates new form IndexedEditorPanel */
public IndexedEditorPanel(Node node, Node.Property[] props) {
    treeTableView1 = new TreeTableView();

    // install proper border
    setBorder((Border) UIManager.get("Nb.ScrollPane.border")); // NOI18N
    initComponents();
    propertiesLabel.setLabelFor(treeTableView1);

    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel2.add(treeTableView1);

    detailsPanel.setLayout(new java.awt.BorderLayout());
    getExplorerManager().setRootContext(node);

    rootNode = node;
    prop = props[0];
    getExplorerManager().addPropertyChangeListener(this);
    treeTableView1.setProperties(props);
    treeTableView1.setRootVisible(false);
    treeTableView1.setDefaultActionAllowed(false);
    treeTableView1.setTreePreferredWidth(200);

    node.addPropertyChangeListener(this);

    try {
        ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);
        if (l == null) {
            l = Thread.currentThread().getContextClassLoader();
        }
        if (l == null) {
            l = getClass().getClassLoader();
        }
        
        selectedLookup = org.openide.util.lookup.Lookups.proxy(this);

        NodeAction globalMoveUp = SystemAction.get(Class.forName("org.openide.actions.MoveUpAction", true, l).asSubclass(NodeAction.class)); // NOI18N
        NodeAction globalMoveDown = SystemAction.get(Class.forName("org.openide.actions.MoveDownAction", true, l).asSubclass(NodeAction.class)); // NOI18N
        NodeAction globalNewAction = SystemAction.get(Class.forName("org.openide.actions.NewAction", true, l).asSubclass(NodeAction.class)); // NOI18N

        // Get context aware instances.
        moveUp = globalMoveUp.createContextAwareInstance(selectedLookup);
        moveDown = globalMoveDown.createContextAwareInstance(selectedLookup);
        newAction = globalNewAction.createContextAwareInstance(selectedLookup);
    } catch (ClassNotFoundException cnfe) {
        LOG.log(Level.INFO, "Maybe missing openide.actions module?", cnfe);
    }

    java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class);
    treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties"));
    newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New"));
    deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete"));
    upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp"));
    downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown"));
    getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel"));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:57,代碼來源:IndexedEditorPanel.java


注:本文中的org.openide.nodes.Node.addPropertyChangeListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。