本文整理了Java中org.openide.nodes.AbstractNode.setDisplayName()
方法的一些代码示例,展示了AbstractNode.setDisplayName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractNode.setDisplayName()
方法的具体详情如下:
包路径:org.openide.nodes.AbstractNode
类名称:AbstractNode
方法名:setDisplayName
暂无
代码示例来源:origin: org.netbeans.api/org-openide-nodes
/**
* 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;
}
代码示例来源:origin: org.netbeans.api/org-openide-nodes
/** 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);
}
}
代码示例来源:origin: org.netbeans.api/org-openide-nodes
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);
}
}
代码示例来源:origin: dschanoeh/Kayak
@Override
public void setDisplayName(String s) {
super.setDisplayName(s);
project.setName(s);
}
代码示例来源:origin: org.codehaus.mevenide/nb-repo-browser
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;
代码示例来源:origin: org.codehaus.mevenide/lifecycle-build-plan
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;
}
代码示例来源:origin: org.codehaus.mevenide/nb-repo-browser
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;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javacard-spi
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;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javacard-spi
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;
}
代码示例来源:origin: net.sourceforge.javydreamercsw/Client-UI
@Override
protected Node createNodeForKey(Step key) {
AbstractNode node = new AbstractNode(Children.LEAF);
node.setDisplayName("Step: "+key.getStepSequence());
return node;
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/** 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);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-repository
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;
}
代码示例来源:origin: org.codehaus.mevenide/nb-project
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 };
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-project-ant-ui
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};
}
代码示例来源:origin: dschanoeh/Kayak
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);
}
代码示例来源:origin: dschanoeh/Kayak
@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};
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project
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();
}
代码示例来源:origin: dschanoeh/Kayak
@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;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project
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();
}
代码示例来源:origin: dschanoeh/Kayak
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());
}
内容来源于网络,如有侵权,请联系作者删除!