-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqPropertySheetNodes
I want to have the properties of my custom nodes displayed in the Properties view when they are selected in my tree view. How do I go about doing that?
Listen for changes in the selected nodes in the [http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/ExplorerManager.html ExplorerManager
], and set the activatedNodes
property on the parent [[DevFaqWindowsTopComponent| TopComponent
]] which contains your tree view:
public class MyComponent extends TopComponent implements PropertyChangeListener {
private ExplorerManager explorerManager;
public MyComponent() {
explorerManager = new ExplorerManager();
explorerManager.addPropertyChangeListener(this);
}
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getSource() == explorerManager &&
ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
setActivatedNodes(explorerManager.getSelectedNodes());
}
}
}
Note that the example above is not a complete TopComponent
implementation with a tree view and nodes. It is simply demonstrating how to have the selected node’s properties shown in the Properties view.
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqPropertySheetNodes , that was last modified by NetBeans user Tboudreau on 2010-02-25T16:17:19Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.