/** * 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; }
/** 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 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); } }
@Override public void setDisplayName(String s) { super.setDisplayName(s); project.setName(s); }
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;
public static Node createLoadingNode() { AbstractNode nd = new AbstractNode(Children.LEAF) { @Override public Image getIcon(int arg0) { return Utilities.loadImage("org/codehaus/mevenide/buildplan/nodes/wait.gif"); } }; nd.setName("Loading"); //NOI18N nd.setDisplayName(NbBundle.getMessage(NodeUtils.class, "Node_Loading")); return nd; }
public static Node createEmptyNode() { AbstractNode nd = new AbstractNode(Children.LEAF) { @Override public Image getIcon(int arg0) { return Utilities.loadImage("org/codehaus/mevenide/repository/empty.png"); } @Override public Image getOpenedIcon(int arg0) { return getIcon(arg0); } }; nd.setName("Empty"); //NOI18N nd.setDisplayName(NbBundle.getMessage(FindResultsPanel.class, "LBL_Node_Empty")); return nd; }
private Node invalidPlatformNode() { AbstractNode result = new AbstractNode(Children.LEAF); result.setIconBaseWithExtension("org/netbeans/modules/javacard/resources/empty.png"); //NOI18N result.setDisplayName(NbBundle.getMessage(DevicePanel.class, "LBL_INVALID_PLATFORM_SELECTED")); //NOI18N return result; }
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; }
@Override protected Node createNodeForKey(Step key) { AbstractNode node = new AbstractNode(Children.LEAF); node.setDisplayName("Step: "+key.getStepSequence()); return node; } }
/** 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); } }
static Node createPartialNode() { AbstractNode node = new AbstractNode(Children.LEAF); node.setIconBaseWithExtension("org/netbeans/modules/maven/resources/wait.gif"); node.setDisplayName(TXT_Partial_result()); return node; }
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 }; }
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}; }
public BusNode(Bus bus, Project project) { super(new BusChildFactory(bus, project), Lookups.fixed(bus, project)); setIconBaseWithExtension("com/github/kayak/ui/icons/network-workgroup.png"); super.setDisplayName(bus.toString()); this.bus = bus; this.project = project; bus.addBusChangeListener(changeListener); }
@Override protected Node[] createNodesForKey(String key) { AbstractNode node = new AbstractNode(Children.create(new PlatformChildFactory(key), false)); node.setIconBaseWithExtension("com/github/kayak/logging/icons/folder.svg"); node.setDisplayName(key); return new Node[] {node}; } }
public ResourceBundleBrandingPanel(BrandingModel model) { super(getMessage("LBL_ResourceBundleTab"), model); //NOI18N initComponents(); searchField.getDocument().addDocumentListener(searchListener); searchField.addFocusListener(searchListener); manager = new ExplorerManager(); rootNode = null; waitRoot = getWaitRoot(); waitRoot.setName(getMessage("LBL_ResourceBundlesList")); // NOI18N waitRoot.setDisplayName(getMessage("LBL_ResourceBundlesList")); // NOI18N manager.setRootContext(waitRoot); branding = getBranding(); prj = branding.getProject(); }
@Override protected Node[] createNodesForKey(Folders key) { if(key == Folders.DIRECTORY) { AbstractNode node = new AbstractNode(Children.create(new LogDirectoryFactory(), true)); node.setDisplayName("Log directory"); node.setIconBaseWithExtension("com/github/kayak/logging/icons/folder.png"); return new Node[] {node}; } else if(key == Folders.FAVOURTIES) { AbstractNode node = new AbstractNode(Children.create(new LogFavouritesFactory(), true)); node.setDisplayName("Favourites"); node.setIconBaseWithExtension("com/github/kayak/logging/icons/bookmark-new.png"); return new Node[] {node}; } return null; }
public InternationalizationResourceBundleBrandingPanel(BrandingModel model) { super(getMessage("LBL_InternationalizationResourceBundleTab"), model); //NOI18N initComponents(); searchField.getDocument().addDocumentListener(searchListener); searchField.addFocusListener(searchListener); manager = new ExplorerManager(); rootNode = null; waitRoot = getWaitRoot(); waitRoot.setName(getMessage("LBL_ResourceBundlesList")); // NOI18N waitRoot.setDisplayName(getMessage("LBL_ResourceBundlesList")); // NOI18N manager.setRootContext(waitRoot); branding = getBranding(); prj = branding.getProject(); attachListeners(); }
public ProjectNode(Project project) { super(Children.LEAF, Lookups.fixed(project)); setIconBaseWithExtension("com/github/kayak/ui/icons/folder.png"); this.project = project; project.addProjectChangeListener(changeListener); if (project.isOpened()) { setChildren(Children.create(new ProjectChildFactory(project), true)); setIconBaseWithExtension("com/github/kayak/ui/icons/folder-open.png"); } super.setDisplayName(project.getName()); }