Java Code Examples for org.openide.nodes.AbstractNode#setIconBaseWithExtension()

The following examples show how to use org.openide.nodes.AbstractNode#setIconBaseWithExtension() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TreeModelNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public Node[] createNodes (Object object) {
    if (object == WAIT_KEY) {
        AbstractNode n = new AbstractNode(Children.LEAF);
        n.setName(NbBundle.getMessage(TreeModelNode.class, "WaitNode"));
        n.setIconBaseWithExtension("org/netbeans/modules/viewmodel/wait.gif");
        return new Node[] { n };
    }
    if (object instanceof Exception)
        return new Node[] {
            new ExceptionNode ((Exception) object)
        };
    TreeModelNode tmn = new TreeModelNode (
        model,
        columns,
        treeModelRoot, 
        object
    );
    //System.err.println("created node for ("+object+") = "+tmn);
    synchronized (objectToNode) {
        objectToNode.put (object, new WeakReference<TreeModelNode>(tmn));
    }
    return new Node[] {tmn};
}
 
Example 2
Source File: BasicReplaceResultsPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void showFinishedInfo() {
    final AbstractNode an = new AbstractNode(Children.LEAF);
    an.setIconBaseWithExtension(
            "org/netbeans/modules/search/res/info.png");            //NOI18N
    an.setDisplayName(NbBundle.getMessage(ResultView.class,
            "TEXT_INFO_REPLACE_FINISHED", //NOI18N
            resultModel.getSelectedMatchesCount()));
    Mutex.EVENT.writeAccess(new Runnable() {
        @Override
        public void run() {
            getOutlineView().getOutline().setRootVisible(true);
            getExplorerManager().setRootContext(an);
            getOutlineView().validate();
            getOutlineView().repaint();
            btnNext.setEnabled(false);
            btnPrev.setEnabled(false);
            btnTreeView.setEnabled(false);
            btnFlatView.setEnabled(false);
            btnExpand.setEnabled(false);
        }
    });
}
 
Example 3
Source File: ClassPathFileChooser.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Node getRootNode(FileObject fileInProject, Filter filter) {
    Children children = new Children.Array();
    children.add(createPackageRootNodes(fileInProject, choosingFolder, filter));
    AbstractNode root = new AbstractNode(children);
    root.setIconBaseWithExtension("org/netbeans/modules/form/editors2/iconResourceRoot.gif"); // NOI18N
    root.setDisplayName(NbBundle.getMessage(ClassPathFileChooser.class, "CTL_ClassPathName")); // NOI18N
    // ProjectUtils.getInformation(prj).getDisplayName()
    return root;
}
 
Example 4
Source File: InstanceTargetXNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Node createWaitNode() {
    AbstractNode node = new AbstractNode(Children.LEAF);
    node.setName(NbBundle.getMessage(InstanceTargetXNode.class, "LBL_WaitNode_DisplayName"));
    node.setIconBaseWithExtension("org/netbeans/modules/j2ee/deployment/impl/ui/resources/wait.gif"); // NOI18N
    
    Children.Array children = new Children.Array();
    children.add(new Node[]{node});
    return new AbstractNode(children);
}
 
Example 5
Source File: Util.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static Node createInfoNode() {
    AbstractNode n = new AbstractNode(Children.LEAF);
    n.setName(NbBundle.getMessage(WildflyItemNode.class, "LBL_InfoNode_DisplayName")); //NOI18N
    n.setShortDescription(NbBundle.getMessage(WildflyItemNode.class, "LBL_InfoNode_ToolTip")); //NOI18N
    n.setIconBaseWithExtension("org/netbeans/core/resources/exception.gif"); // NOI18N
    return n;
}
 
Example 6
Source File: LazyProject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected Collection<Node> initCollection() {
    AbstractNode n = new AbstractNode(Children.LEAF);
    n.setName("init"); // NOI18N
    n.setDisplayName(NbBundle.getMessage(ProjCh.class, "MSG_ProjChInit")); 
    n.setIconBaseWithExtension("org/netbeans/modules/project/ui/resources/wait.gif");
    return Collections.singletonList((Node)n);
}
 
Example 7
Source File: UINode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected Node[] createNodes(Object key) {
    AbstractNode an = new AbstractNode(Children.LEAF);
    an.setName((String)key);
    an.setIconBaseWithExtension("org/netbeans/lib/uihandler/module.gif"); // NOI18N
    return new Node[] { an };
}
 
Example 8
Source File: Nodes.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages("LBL_Wait=Please Wait...")
public static Node createWaitNode() {
    AbstractNode an = new AbstractNode(Children.LEAF);
    an.setIconBaseWithExtension(WAIT_GIF);
    an.setDisplayName(Bundle.LBL_Wait());
    return an;
}
 
Example 9
Source File: GoalsPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_Wait=Please Wait...")
private static Node createWaitNode() {
    AbstractNode an = new AbstractNode(Children.LEAF);
    an.setIconBaseWithExtension(WAIT_GIF);
    an.setDisplayName(Bundle.LBL_Wait());
    return an;
}
 
Example 10
Source File: PagedBatchTupleFactory.java    From Llunatic with GNU General Public License v3.0 5 votes vote down vote up
private Node createWaitNode() {
    AbstractNode n = new AbstractNode(Children.LEAF) {
        public @Override
        Action[] getActions(boolean context) {
            return new Action[0];
        }
    };
    n.setIconBaseWithExtension("org/openide/nodes/wait.gif"); //NOI18N
    n.setDisplayName(NbBundle.getMessage(ChildFactory.class, "LBL_WAIT")); //NOI18N
    return n;
}
 
Example 11
Source File: GoalsPanel.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Messages("LBL_Wait=Please Wait...")
private static Node createWaitNode() {
    AbstractNode an = new AbstractNode(Children.LEAF);
    an.setIconBaseWithExtension(WAIT_GIF);
    an.setDisplayName(Bundle.LBL_Wait());
    return an;
}
 
Example 12
Source File: SaasNodeChildren.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected static Node[] getWaitNode() {
    AbstractNode wait = new AbstractNode(Children.LEAF);
    wait.setName(NbBundle.getMessage(WsdlSaasNodeChildren.class, "NODE_LOAD_MSG")); // NOI18N
    wait.setIconBaseWithExtension("org/netbeans/modules/websvc/saas/ui/resources/wait.gif"); // NOI18N
    return new Node[] { wait };
}
 
Example 13
Source File: OverrideEmbeddedAssociationChildFactory.java    From jeddict with Apache License 2.0 4 votes vote down vote up
@Override
protected Node createNodeForKey(final AttributeWidget attributeWidget) {
    Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec();
    AbstractNode node = null;
    if (attributeWidget instanceof EmbeddedAttributeWidget) {
        EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget;
        Attribute attributeSpec = (Attribute) embeddedAttributeWidget.getBaseElementSpec(); //May be Embedded or ElementCollection ( for multi Embedded )
        String prefixAttributePath_Tmp;
        if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) {
            prefixAttributePath_Tmp = attributeSpec.getName();
        } else {
            prefixAttributePath_Tmp = prefixAttributePath + "." + attributeSpec.getName();
        }
        node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAssociationChildFactory(entityWidget, prefixAttributePath_Tmp, initialAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true));
    } else {
        node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) {

            @Override
            public void createPropertySet(ElementPropertySet set) {
                if (initialAttributeWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) {
                    Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec();
                    AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) initialAttributeWidget.getBaseElementSpec();
                    AssociationOverride associationOverride = null;
                    if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) {
                        associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName());
                    } else {
                        associationOverride = associationOverrideHandler.getAssociationOverride(prefixAttributePath + "." + attributeSpec.getName());
                    }

                    if (attributeSpec instanceof JoinColumnHandler) {
                        set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn()));
                    }

                    set.createPropertySet(attributeWidget, associationOverride.getJoinTable());
                    set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn()));
                    set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn()));
                }
            }

        };
    }
    node.setDisplayName(attribute.getName());
    node.setShortDescription(attribute.getName());
    node.setIconBaseWithExtension(attributeWidget.getIconPath());
    return node;
}
 
Example 14
Source File: POMModelPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static Node createWaitNode() {
    AbstractNode an = new AbstractNode(Children.LEAF);
    an.setIconBaseWithExtension("org/netbeans/modules/maven/navigator/wait.gif"); //NOI18N
    an.setDisplayName(NbBundle.getMessage(POMInheritancePanel.class, "LBL_Wait"));
    return an;
}
 
Example 15
Source File: NodeFactorySupport.java    From netbeans with Apache License 2.0 4 votes vote down vote up
static Node createWaitNode() {
    AbstractNode n = new AbstractNode(Children.LEAF);
    n.setIconBaseWithExtension("org/openide/nodes/wait.gif"); //NOI18N
    n.setDisplayName(NbBundle.getMessage(ChildFactory.class, "LBL_WAIT")); //NOI18N
    return n;
}
 
Example 16
Source File: Util.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public static Node createWaitNode() {
    AbstractNode n = new AbstractNode(Children.LEAF);
    n.setName(NbBundle.getMessage(WildflyItemNode.class, "LBL_WaitNode_DisplayName")); //NOI18N
    n.setIconBaseWithExtension("org/netbeans/modules/javaee/wildfly/resources/wait.gif"); // NOI18N
    return n;
}
 
Example 17
Source File: OverrideEmbeddedAllChildFactory.java    From jeddict with Apache License 2.0 4 votes vote down vote up
@Override
protected Node createNodeForKey(final AttributeWidget attributeWidget) {
    Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec();
    AbstractNode node = null;
    if (attributeWidget instanceof EmbeddedAttributeWidget) {
        EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget;
        Attribute attributeSpec = (Attribute) embeddedAttributeWidget.getBaseElementSpec(); //May be Embedded or ElementCollection ( for multi Embedded )
        String prefixAttributePath_Tmp;
        if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) {
            prefixAttributePath_Tmp = attributeSpec.getName();
        } else {
            prefixAttributePath_Tmp = prefixAttributePath + "." + attributeSpec.getName();
        }
        node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAllChildFactory(entityWidget, prefixAttributePath_Tmp, initialAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true));
    } else {
        node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) {

            @Override
            public void createPropertySet(ElementPropertySet set) {

                if (attributeWidget instanceof RelationAttributeWidget && initialAttributeWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) {
                    Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec();
                    AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) initialAttributeWidget.getBaseElementSpec();
                    AssociationOverride associationOverride = null;
                    if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) {
                        associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName());
                    } else {
                        associationOverride = associationOverrideHandler.getAssociationOverride(prefixAttributePath + "." + attributeSpec.getName());
                    }

                    if (attributeSpec instanceof JoinColumnHandler) {
                        set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn()));
                    }

                    set.createPropertySet(attributeWidget, associationOverride.getJoinTable());
                    set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn()));
                    set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn()));
                } else if (initialAttributeWidget.getBaseElementSpec() instanceof AttributeOverrideHandler) {
                    Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec();
                    AttributeOverrideHandler attributeOverrideHandler = (AttributeOverrideHandler) initialAttributeWidget.getBaseElementSpec();
                    AttributeOverride attributeOverride = null;
                    if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) {
                        attributeOverride = attributeOverrideHandler.getAttributeOverride(attributeSpec.getName());
                    } else {
                        attributeOverride = attributeOverrideHandler.getAttributeOverride(prefixAttributePath + "." + attributeSpec.getName());
                    }
                    set.createPropertySet(attributeWidget, attributeOverride.getColumn(), attributeWidget.getPropertyChangeListeners(), attributeWidget.getPropertyVisibilityHandlers());
                }
            }

        };
    }
    node.setDisplayName(attribute.getName());
    node.setShortDescription(attribute.getName());
    node.setIconBaseWithExtension(attributeWidget.getIconPath());
    return node;
}
 
Example 18
Source File: AddModuleAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private Project[] getSelectedProjects(FileObject projDir) throws UserCancelException {
    Project[] allProjects = OpenProjects.getDefault().getOpenProjects();
    List<Node> moduleProjectNodes = new LinkedList<Node>();
    for (int i = 0; i < allProjects.length; i++) {
        if (EarProjectUtil.isJavaEEModule(allProjects[i])) {
            LogicalViewProvider lvp = allProjects[i].getLookup().lookup(LogicalViewProvider.class);
            Node mn = lvp.createLogicalView();
            Node n = new FilterNode(mn, new FilterNode.Children(mn), Lookups.singleton(allProjects[i]));
            moduleProjectNodes.add(n);
        }
    }
    Children.Array children = new Children.Array();
    children.add(moduleProjectNodes.toArray(new Node[moduleProjectNodes.size()]));
    final AbstractNode root = new AbstractNode(children);
    String moduleSelector = NbBundle.getMessage(AddModuleAction.class, "LBL_ModuleSelectorTitle");
    
    Project parent = FileOwnerQuery.getOwner(projDir);
    SubprojectProvider spp = parent.getLookup().lookup(SubprojectProvider.class);
    if (null != spp) {
        final Set s = spp.getSubprojects();
        NodeAcceptor na = new NodeAcceptor() {
            public boolean acceptNodes(Node[] nodes) {
                for (int i = 0; i < nodes.length; i++) {
                    if (nodes[i].getParentNode() != root) {
                        return false;
                    }
                    // do not put this test befor the root test...
                    Project p = nodes[i].getLookup().lookup(Project.class);
                    if (null == p) {
                        return false;
                    }
                    if (s.contains(p)) {
                        return false;
                    }
                }
                return nodes.length > 0;
            }
        };
        root.setDisplayName(NbBundle.getMessage(AddModuleAction.class, "LBL_J2EEModules"));
        root.setIconBaseWithExtension(FOLDER_ICON);
        Node[] selected = NodeOperation.getDefault().select(moduleSelector, root.getDisplayName(), root, na);
        Project[] modules = new Project[selected.length];
        for (int i = 0; i < modules.length; i++) {
            modules[i] = selected[i].getLookup().lookup(Project.class);
        }
        return modules;
  }
    else {
        return new Project[0];
    }
}
 
Example 19
Source File: JBServletsChildren.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private Node createWaitNode() {
    AbstractNode n = new AbstractNode(Children.LEAF);
    n.setName(NbBundle.getMessage(JBApplicationsChildren.class, "LBL_WaitNode_DisplayName")); //NOI18N
    n.setIconBaseWithExtension("org/netbeans/modules/j2ee/jboss4/resources/wait.gif"); // NOI18N
    return n;
}
 
Example 20
Source File: Hk2ItemNode.java    From netbeans with Apache License 2.0 3 votes vote down vote up
/**
 * Creates and returns the instance of the node representing the status
 * 'WAIT' of the node.
 * <p/>
 * It is used when it spent more time to create elements hierarchy.
 * <p/>
 * @return The wait node.
 */
public static Node createWaitNode() {
    AbstractNode node = new AbstractNode(Children.LEAF);
    node.setName(NbBundle.getMessage(Hk2ItemNode.class,
            "LBL_WaitNode_DisplayName"));
    node.setIconBaseWithExtension("org/openide/src/resources/wait.gif");
    return node;
}