本文整理匯總了Java中org.openide.nodes.AbstractNode.setShortDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractNode.setShortDescription方法的具體用法?Java AbstractNode.setShortDescription怎麽用?Java AbstractNode.setShortDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.nodes.AbstractNode
的用法示例。
在下文中一共展示了AbstractNode.setShortDescription方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createNodes
import org.openide.nodes.AbstractNode; //導入方法依賴的package包/類
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};
}
示例2: taskFinished
import org.openide.nodes.AbstractNode; //導入方法依賴的package包/類
@Override
@NbBundle.Messages({
"LBL_NoModesFound=No layout definition found",
"MSG_NoModesFound=Is everything OK? Did your application compile and run?"
})
public void taskFinished(Task task) {
handle.finish();
FileObject modeDir = userDir.get().getFileObject("config/Windows2Local/Modes");
boolean one = false;
final Children ch = getExplorerManager().getRootContext().getChildren();
if (modeDir != null) {
try {
FileSystem layer = DesignSupport.findLayer(data.getProject());
if (layer == null) {
throw new IOException("Cannot find layer in " + data.getProject()); // NOI18N
}
data.setSFS(layer);
for (FileObject m : modeDir.getChildren()) {
if (m.isData() && "wsmode".equals(m.getExt())) {
ModeNode mn = new ModeNode(m, data);
ch.add(new Node[] { mn });
one = true;
}
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
if (!one) {
AbstractNode empty = new AbstractNode(Children.LEAF);
empty.setName("empty"); // NOI18N
empty.setDisplayName(Bundle.LBL_NoModesFound());
empty.setShortDescription(Bundle.MSG_NoModesFound());
ch.add(new Node[] { empty });
markInvalid();
} else {
markValid();
}
EventQueue.invokeLater(this);
}