|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Nokia. Portions Copyright 2003 Nokia. * All Rights Reserved. */ package org.netbeans.api.enode; import java.util.ArrayList; import javax.swing.Action; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.util.Lookup; import org.netbeans.modules.enode.ExtensibleNodeActions; import org.netbeans.modules.enode.ExtensibleNodeLookup; import org.netbeans.modules.enode.ExtensibleNodeIcons; /** * A node capable of reading the list of actions from * the system file system. The content of its lookup can also be * specified declaratively. * @author David Strupl */ public class ExtensibleNode extends AbstractNode { /** Folder on the system filesystem (context in the Registry) * where actions for extensible nodes are stored. */ public static final String E_NODE_ACTIONS = "/ExtensibleNode/Actions/"; // NOI18N /** Folder on the system filesystem (context in the Registry) * where lookup objects for extensible nodes are stored. */ public static final String E_NODE_LOOKUP = "/ExtensibleNode/Lookup/"; // NOI18N /** Folder on the system filesystem (context in the Registry) * where the icons base dirs are stored. */ public static final String E_NODE_ICONS = "/ExtensibleNode/Icons/"; // NOI18N /** * Our JNDI context paths. */ private String[] paths; /** * Reference the implementation of the actions finder. */ private ExtensibleNodeActions actionManager; /** * Reference the implementation of the icons finder. */ private ExtensibleNodeIcons iconManager; /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions, lookup objects and icon. * @param path folder path on the system file system * @param useHierarchicalPath whether the content of parent folders * up to the root for a given entity (actions, lookup) is to be * taken into account when searching for the objects */ public ExtensibleNode(String path, boolean useHierarchicalPath) { this(useHierarchicalPath ? computeHierarchicalPaths(path) : new String[] { path } ); } /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions, lookup objects and icon. * @param path folder path on the system file system */ public ExtensibleNode(String[] paths) { this(Children.LEAF, paths); } /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions, lookup objects and icon. * @param ch children of the node * @param path folder path on the system file system * @param useHierarchicalPath whether the content of parent folders * up to the root for a given entity (actions, lookup) is to be * taken into account when searching for the objects */ public ExtensibleNode(Children ch, String path, boolean useHierarchicalPath) { this(ch, useHierarchicalPath ? computeHierarchicalPaths(path) : new String[] { path } ); } /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions, lookup objects and icon. * @param ch children of the node * @param path folder path on the system file system */ public ExtensibleNode(Children ch, String[] paths) { this(ch, paths, new ExtensibleNodeLookup()); } /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions and icon. Warning: By using this constructor * you are responsible for creating the lookup for this node. The * extensible lookup is NOT used in this case. * @param ch children of the node * @param path folder path on the system file system * @param Lookup l used as a lookup for this node. * Warning: By using this constructor * you are responsible for creating the lookup for this node. The * extensible lookup is NOT used in this case. * @param useHierarchicalPath whether the content of parent folders * up to the root for a given entity (actions, lookup) is to be * taken into account when searching for the objects */ public ExtensibleNode(Children ch, Lookup l, String path, boolean useHierarchicalPath) { this(ch, l, useHierarchicalPath ? computeHierarchicalPaths(path) : new String[] { path } ); } /** * Creates a new instance of ExtensibleNode. The paths * parameter is used as a base directory for finding * actions and icon. Warning: By using this constructor * you are responsible for creating the lookup for this node. The * extensible lookup is NOT used in this case. * @param ch children of the node * @param path folder path on the system file system * @param Lookup l used as a lookup for this node. * Warning: By using this constructor * you are responsible for creating the lookup for this node. The * extensible lookup is NOT used in this case. */ public ExtensibleNode(Children ch, Lookup l, String[] paths) { super(ch, l); this.paths = paths; String iBase = getIconManager().getIconBase(); if (iBase != null) { setIconBase(iBase); } } /** * Private constructor taking the lookup argument. The lookup is * not fully initialized until the call to |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.