Search Results

Search found 4 results on 1 pages for 'badgirl'.

Page 1/1 | 1 

  • How does lookup work?

    - by badgirl
    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.

    Read the article

  • why this code not works?

    - by badgirl
    Hello. I want to create new node of BeanTreeView, and when I add some node in constructor, then run the app, and then I try to view the window with tree, it throws this error java.lang.AssertionError: Component cannot be created for {component=null, displayName=Exploirer, instanceCreate=AlwaysEnabledAction[Exploirer]} at org.openide.windows.OpenComponentAction.getTopComponent(OpenComponentAction.java:71) Why? And how to add node there? See the code. private ProjectsChildren projectsChildren; private ProjectNode projectNode = new ProjectNode(new MainProject("ggg"), projectsChildren); public ExploirerTopComponent() { initComponents(); setName(NbBundle.getMessage(ExploirerTopComponent.class, "CTL_ExploirerTopComponent")); setToolTipText(NbBundle.getMessage(ExploirerTopComponent.class, "HINT_ExploirerTopComponent")); // setIcon(ImageUtilities.loadImage(ICON_PATH, true)); //map.put("delete", ExplorerUtils.actionDelete(mgr, true)); associateLookup (ExplorerUtils.createLookup(mgr, getActionMap())); //projectsChildren.createProject("demence"); /* somewhere here is the problem*/ mgr.setRootContext(projectNode); ProjectNode[] pr = null; pr[0] = projectNode; mgr.getRootContext().getChildren().add(pr); }

    Read the article

  • How to find selected node in Tree?

    - by badgirl
    Hello. I have dynamic tree (moreover nodes can have children). Every node has some action. When I right click on some node, it offers me some actions. One action, for example createChildNode creates child node, which in turn creates MyObject2. MyObject2 must be created with assistance of MyOject1, which was created in parent node(that one where I right click for actions ). How to get that object from selected node? That objects in nodes are putted to lookups.singleton(MyObjectX)

    Read the article

  • Why I cannot call setSomething()?

    - by badgirl
    Hello. I dont know how to acces my method of my class ProjectNode, that is returned from ExplorerManager mgr like this: mgr.getRootContext().setSomething() getRootContext() returns Node object, but I put class ProjectNode (extends AbstractNode, abstractNode extends Node)into rootContext. The compiler does not want to eat that line of code. But it must!

    Read the article

1