LazyNode(Map<String,?> map) { this(new AbstractNode(new Children.Array()), map); } private LazyNode(AbstractNode an, Map<String,?> map) {
/** Get an icon for this node in the closed state. * Uses the Bean's icon if possible. * * @param type constant from {@link java.beans.BeanInfo} * @return icon to use */ @Override public Image getIcon(int type) { Image image = beanInfo.getIcon(type); if (image != null) { return image; } return super.getIcon(type); }
private LazyNode(AbstractNode an, Map<String,?> map) { super(an, new SwitchChildren(an)); ((SwitchChildren)getChildren()).node = this; this.map = map; an.setName((String) map.get("name")); // NOI18N an.setDisplayName((String) map.get("displayName")); // NOI18N an.setShortDescription((String) map.get("shortDescription")); // NOI18N String iconBase = (String) map.get("iconResource"); // NOI18N if (iconBase != null) { an.setIconBaseWithExtension(iconBase); } }
/** The lookup associated with this cookie set. Keeps track of * the same things that are in the cookie set, but presents them * as being inside the lookup. * * @return the lookup representing this cookie set * @since 7.0 */ public Lookup getLookup() { synchronized (QUERY_MODE) { if (lookup == null) { AbstractNode an = new AbstractNode(this); lookup = an.getLookup(); } } return lookup; }
/** * Create the Node that should be shown while the keys are being computed * on a background thread. * This method will not be called if this ChildFactory is used for a * synchronous children which does not compute its keys on a background * thread. Whether an instance is synchronous or not is determined by a * parameter to * <a href="Children.html#create(ChildFactory, boolean)">Children.create()</a>. * <p> * To show no node at all when the Children object is initially expanded in * the UI, simply return null. * <p> * The default implementation returns a Node that shows an hourglass cursor * and the localized text "Please Wait...". * * @return A Node, or null if no wait node should be shown. */ protected 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; }
private Node noPlatformNode() { AbstractNode result = new AbstractNode(Children.LEAF); result.setIconBaseWithExtension("org/netbeans/modules/javacard/resources/empty.png"); //NOI18N result.setDisplayName(NbBundle.getMessage(DevicePanel.class, "LBL_NO_PLATFORM_SELECTED")); //NOI18N return result; }
@Messages("LBL_Node_TooGeneral=Too general query") private static Node getTooGeneralNode() { if (tooGeneralNode == null) { AbstractNode nd = new AbstractNode(Children.LEAF) { @Override public Image getIcon(int arg0) { return ImageUtilities.loadImage(EMPTY_ICON); } @Override public Image getOpenedIcon(int arg0) { return getIcon(arg0); } }; nd.setName("Too General"); //NOI18N nd.setDisplayName(LBL_Node_TooGeneral()); //NOI18N tooGeneralNode = nd; } return new FilterNode (tooGeneralNode, Children.LEAF); }
public static Node createWaitNode() { AbstractNode n = new AbstractNode(Children.LEAF); n.setName(NbBundle.getMessage(JBItemNode.class, "LBL_WaitNode_DisplayName")); //NOI18N n.setIconBaseWithExtension("org/netbeans/modules/j2ee/jboss4/resources/wait.gif"); // NOI18N return n; }
public static Node[] createNodes(Archetype arch, Children childs) { if (arch == LOADING_ARCHETYPE) { AbstractNode loading = new AbstractNode(Children.LEAF); loading.setName("loading"); //NOI18N loading.setDisplayName(NbBundle.getMessage(ChooseArchetypePanel.class, "LBL_Loading")); return new Node[] {loading}; } AbstractNode nd = new AbstractNode(childs); String dn = arch.getName() == null ? arch.getArtifactId() : arch.getName(); nd.setName(dn); nd.setDisplayName(dn); nd.setIconBaseWithExtension("org/codehaus/mevenide/netbeans/Maven2Icon.gif"); //NOI18N nd.setValue(PROP_ARCHETYPE, arch); return new Node[] { nd }; }
public static Node createInfoNode() { AbstractNode n = new AbstractNode(Children.LEAF); n.setName(NbBundle.getMessage(JBItemNode.class, "LBL_InfoNode_DisplayName")); //NOI18N n.setShortDescription(NbBundle.getMessage(JBItemNode.class, "LBL_InfoNode_ToolTip")); //NOI18N n.setIconBaseWithExtension("org/netbeans/core/resources/exception.gif"); // NOI18N return n; }
public static Node createLoadingNode() { AbstractNode nd = new AbstractNode(Children.LEAF){ @Override public Image getIcon(int arg0) { return Utilities.loadImage("org/codehaus/mevenide/repository/wait.gif"); } }; nd.setName("Loading"); //NOI18N nd.setDisplayName(NbBundle.getMessage(GroupListChildren.class, "Node_Loading")); return nd; } private List keys;
@Override protected Node createNodeForKey(Step key) { AbstractNode node = new AbstractNode(Children.LEAF); node.setDisplayName("Step: "+key.getStepSequence()); return node; } }
/** To allow inner classes to access the super.setName method. */ void setNameSilently(String name) { super.setName(name); }
protected Node[] createNodes(Key key) { Node node = nodesHash.get(key); if (!nodesHash.containsKey(key)){ node = null; if (key.ejbType == Key.EjbType.SESSION) { // do not create node for web service if (!key.isWebService && nodeFactory != null) { node = nodeFactory.createSessionNode(key.ejbClass, ejbModule, project); } } if (key.ejbType == Key.EjbType.ENTITY && nodeFactory != null) { node = nodeFactory.createEntityNode(key.ejbClass, ejbModule, project); } if (key.ejbType == Key.EjbType.MESSAGE_DRIVEN && nodeFactory != null) { node = nodeFactory.createMessageNode(key.ejbClass, ejbModule, project); } if (key == Key.SCANNING){ node = new AbstractNode(Children.LEAF); node.setDisplayName(NbBundle.getMessage(EjbContainerChildren.class, "MSG_Scanning_EJBs")); //NOI18N ((AbstractNode)node).setIconBaseWithExtension("org/netbeans/modules/j2ee/ejbjar/project/ui/wait.gif"); //NOI18N } nodesHash.put(key, node); } return node == null ? null : new Node[] { node }; }
protected Node[] createNodes(Variable var) { Children ch = Children.LEAF; AbstractNode n = new AbstractNode(ch, Lookups.singleton(var)) { @Override public Image getIcon(int type) { return iconDelegate.getIcon(type); } }; n.setName(var.getName()); n.setDisplayName(var.getName() + "("+var.getValue().getPath()+")"); // NOI18N n.setShortDescription(var.getName() + "("+var.getValue().getPath()+")"); // NOI18N return new Node[] {n}; }
/** Get a cookie. * @param clazz representation class * @return the index implementation or children if these match the cookie class, * else using the superclass cookie lookup */ public <T extends Node.Cookie> T getCookie(Class<T> clazz) { if (clazz.isInstance(indexImpl)) { // ok, Index implementor is enough return clazz.cast(indexImpl); } Children ch = getChildren(); if (clazz.isInstance(ch)) { // ok, children are enough return clazz.cast(ch); } return super.getCookie(clazz); } }
/** Set the system name. Fires a property change event. * Also may change the display name according to {@link #displayFormat}. * * @param s the new name */ public void setName(String s) { super.setName(s); MessageFormat mf = displayFormat; if (mf != null) { setDisplayName(mf.format(new Object[] { s })); } else { // additional hack, because if no display name is set, then it // is taken from the getName, that means calling setName can // also change display name // fix of 10665 fireDisplayNameChange(null, null); } }
private Image computeIcon(boolean opened, int type) { Image image; Node iconDelegate = getIconDelegate(); if (opened) { image = iconDelegate != null ? iconDelegate.getOpenedIcon(type) : super.getOpenedIcon(type); } else { image = iconDelegate != null ? iconDelegate.getIcon(type) : super.getIcon(type); } Image badge = ImageUtilities.loadImage(EJB_BADGE); return ImageUtilities.mergeImages(image, badge, 7, 7); }
/** Change the icon. * One need only specify the base resource name without extension; * the real name of the icon is obtained by the applying icon message * formats. * * The method effectively behaves as if it was just delegating * to {@link #setIconBaseWithExtension(java.lang.String)} * using <code>base + ".gif"</code> as parameter. * * @param base base resouce name (no initial slash) * @deprecated Use {@link #setIconBaseWithExtension(java.lang.String)} */ @Deprecated public void setIconBase(String base) { setIconBaseWithExtension(base, DEFAULT_ICON_EXTENSION); }
@Override public void setDisplayName(String s) { super.setDisplayName(s); project.setName(s); }