How does lookup work?
Posted
by badgirl
on Stack Overflow
See other posts from Stack Overflow
or by badgirl
Published on 2010-03-26T21:07:42Z
Indexed on
2010/03/27
3:43 UTC
Read the original article
Hit count: 360
Hello. I have BeanTreeView, and some nodes in it. Every node has constructor
public class ProjectNode extends AbstractNode {
public ProjectNode(MainProject obj, DiagramsChildren childrens) {
super (new ProjectsChildren(), Lookups.singleton(obj));
setDisplayName ( obj.getName());
}
I set Rootnode as a root for tree in ExplorerTopComponent as this:
private final ExplorerManager mgr = new ExplorerManager();
public ExplorerTopComponent(){
associateLookup (ExplorerUtils.createLookup(mgr, getActionMap()));
mgr.setRootContext(new RootNode());
}
And now, how I can get MainProject obj from some node? I need to get it in another class.
© Stack Overflow or respective owner