Monday March 23, 2009
More Complex Database Manager on the NetBeans Platform
Starting with the new NetBeans Platform CRUD Application Tutorial, I ended up with a slightly more complex application. Here, there's also an OutlineView, which has its own Node, with Children that are added via a LookupListener on the Children object:
Note that the viewer and the editor are in 2 separate modules.
As a result, whenever an item is selected in the explorer view, it is (1) shown in the text fields, (2) added to the OutlineView, and (3) shown in the Properties window. However, when an item is selected in the OutlineView, the OutlineView synchronizes with the Properties window, so that the Properties window displays properties of the current item in the OutlineView.
Here's some code I received from Jiri Rechtacek, which is a good introduction to the OutlineView in relation to Nodes:
public class ExampleOutlineView extends JComponent implements ExplorerManager.Provider {
private final Property[] properties;
private final OutlineView outlineView;
private final ExplorerManager manager;
public ExampleOutlineView(final Node rootNode, final Property[] properties) {
this.properties = properties;
outlineView = new OutlineView();
outlineView.setProperties(properties);
manager = new ExplorerManager();
manager.setRootContext(rootNode);
setLayout(new BorderLayout());
add(outlineView, "Center");
}
public final ExplorerManager getExplorerManager() {
return manager;
}
}Mar 23 2009, 07:18:19 AM PDT Permalink
I'm very interested in the OutlineView (with nodes). Do you plan to release the code?
Posted by RunningTracker on March 31, 2009 at 05:52 AM PDT #
The code is in the blog entry above.
Posted by Geertjan on March 31, 2009 at 05:57 AM PDT #
Oh, okay. I thought that maybe you would release the whole project.
Posted by RunningTracker on March 31, 2009 at 06:04 AM PDT #
I can send it to you if you like. Send me an e-mail at geertjan DOT wielenga AT sun DOT com.
Posted by Geertjan on March 31, 2009 at 06:08 AM PDT #
This got me wondering...can OutlineView handle multiple-selection like the PropertySheet can?
Posted by RS on August 10, 2009 at 04:15 PM PDT #


