本文整理匯總了Java中org.openide.nodes.Children.create方法的典型用法代碼示例。如果您正苦於以下問題:Java Children.create方法的具體用法?Java Children.create怎麽用?Java Children.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.nodes.Children
的用法示例。
在下文中一共展示了Children.create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: M2RepositoryBrowser
import org.openide.nodes.Children; //導入方法依賴的package包/類
private M2RepositoryBrowser() {
super(Children.create(new RootNodes(), true));
setName(NAME);
setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
setShortDescription(HINT_M2RepositoryBrowserTopComponent());
setIconBaseWithExtension(ICON_PATH);
NbPreferences.root().node("org/netbeans/modules/maven/nexus/indexing").addPreferenceChangeListener(new PreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
if (RepositoryPreferences.PROP_INDEX.equals(evt.getKey())) {
setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
}
}
});
}
示例2: DependenciesNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
@Messages({
"LBL_Libraries=Dependencies",
"LBL_Test_Libraries=Test Dependencies",
"LBL_Runtime_Libraries=Runtime Dependencies",
"LBL_non_cp_libraries=Non-classpath Dependencies"
})
DependenciesNode(DependenciesSet dependencies) {
super(Children.create(new DependenciesChildren(dependencies), true), Lookups.fixed(dependencies.project, PathFinders.createPathFinder()));
this.dependencies = dependencies;
setName("Dependencies" + dependencies.type); //NOI18N
switch (dependencies.type) {
case COMPILE : setDisplayName(LBL_Libraries()); break;
case TEST : setDisplayName(LBL_Test_Libraries()); break;
case RUNTIME : setDisplayName(LBL_Runtime_Libraries()); break;
default : setDisplayName(LBL_non_cp_libraries()); break;
}
setIconBaseWithExtension(DEF_FOLDER); //NOI18N
}
示例3: createChildren
import org.openide.nodes.Children; //導入方法依賴的package包/類
private static Children createChildren(final List<Node> otherList) {
Children c = Children.create(new ChildFactory<Node>() {
@Override
protected boolean createKeys(final List<Node> toPopulate) {
toPopulate.addAll(otherList);
return true;
}
@Override
protected Node createNodeForKey(Node key) {
return key;
}
}, false);
return c;
}
示例4: ModulesNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
@Messages("LBL_Modules=Modules")
public ModulesNode(NbMavenProjectImpl proj) {
super(Children.create(new ModulesChildFactory(proj), true));
this.proj = proj;
setName("Modules"); //NOI18N
setDisplayName(LBL_Modules());
}
示例5: RootNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
private RootNode(ChildFactory factory, String displayName, String shortDesc, String iconBase, ServerRegistry registry) {
super(Children.create(factory, true));
this.registry = registry;
setName(""); // NOI18N
setDisplayName(displayName);
setShortDescription(shortDesc);
setIconBaseWithExtension(iconBase);
}
示例6: run
import org.openide.nodes.Children; //導入方法依賴的package包/類
@Override
public void run() {
//#164852 somehow a folder dataobject slipped in, test mimetype to avoid that.
// the root cause of the problem is unknown though
Project cp;
synchronized(PROJECT_LOCK) {
cp = currentP;
}
if (cp != null ) { //NOI18N
NbMavenProject mpp = cp.getLookup().lookup(NbMavenProject.class);
if (mpp != null) {
final Children ch = Children.create(new PluginChildren(cp), true);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
treeView.setRootVisible(false);
explorerManager.setRootContext(new AbstractNode(ch));
treeView.expandAll();
}
});
return;
}
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
treeView.setRootVisible(false);
explorerManager.setRootContext(createEmptyNode());
treeView.expandAll(); // Force update view - see bug 242567.
}
});
}
示例7: RootNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
protected RootNode(InstanceContent ic) {
super(Children.create(new YearChildFactory(), true),
new AbstractLookup(ic));
PhotoManager photoManager = Lookup.getDefault().lookup(PhotoManager.class);
reloadResult = photoManager.getLookup().lookup(new Lookup.Template(ReloadCookie.class));
reloadResult.addLookupListener(event -> setChildren(Children.create(new YearChildFactory(), true)));
setDisplayName(Bundle.LBL_RootNode());
setShortDescription(Bundle.HINT_RootNode());
instanceContent = ic;
}
示例8: AndroidSdkNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
public AndroidSdkNode(AndroidSdk p, XMLDataObject holder) {
super(Children.create(new AndroidPlatformChildrenFactory(p, holder), false), Lookups.fixed(new Object[]{p, holder}));
this.platform = p;
p.addPropertyChangeListener(WeakListeners.propertyChange(this, AndroidSdk.DEFAULT_SDK, p));
this.holder = holder;
valid = platform.isValid();
// super.setIconBaseWithExtension("org/netbeans/modules/java/j2seplatform/resources/platform.gif");
}
示例9: DockerNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
private DockerNode(DockerChildFactory factory, String displayName, String shortDesc, String iconBase) {
super(Children.create(factory, true));
setName(""); // NOI18N
setDisplayName(displayName);
setShortDescription(shortDesc);
setIconBaseWithExtension(iconBase);
}
示例10: DockerInstanceNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
public DockerInstanceNode(StatefulDockerInstance instance, DockerInstanceChildFactory factory) {
super(Children.create(factory, true),
Lookups.fixed(instance.getInstance(), instance, factory));
this.instance = instance;
setIconBaseWithExtension(DOCKER_INSTANCE_ICON);
setShortDescription(instance.getInstance().getUrl());
instance.addChangeListener(WeakListeners.change(listener, instance));
instance.refresh();
}
示例11: ServerNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
private ServerNode(ChildFactory factory, DatabaseServer server) {
super(Children.create(factory, true));
this.server = server;
setName(""); // NOI18N
setDisplayName(server.getDisplayName());
setShortDescription(server.getShortDescription());
setIconBaseWithExtension(ICON);
registerListeners();
}
示例12: constructSemiLogicalView
import org.openide.nodes.Children; //導入方法依賴的package包/類
public static Node constructSemiLogicalView(final AnalysisResult errors, final boolean byCategory) {
return new AbstractNode(Children.create(new ChildFactory<Node>() {
@Override protected boolean createKeys(List<Node> toPopulate) {
constructSemiLogicalView(errors, byCategory, toPopulate);
return true;
}
@Override protected Node createNodeForKey(Node key) {
return key;
}
}, true));
}
示例13: constructSemiLogicalViewChildren
import org.openide.nodes.Children; //導入方法依賴的package包/類
private static Children constructSemiLogicalViewChildren(final LogicalViewCache lvc, final Map<FileObject, Map<AnalyzerFactory, List<ErrorDescription>>> errors, final Map<ErrorDescription,Project> errorsToProjects) {
return Children.create(new ChildFactory<Node>() {
@Override protected boolean createKeys(List<Node> toPopulate) {
toPopulate.addAll(constructSemiLogicalViewNodes(lvc, errors, errorsToProjects));
return true;
}
@Override protected Node createNodeForKey(Node key) {
return key;
}
}, true);
}
示例14: MonthNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
public MonthNode(int year, int month) {
super(Children.create(new PhotoNodeFactory(year, month), true), Lookups.singleton(month));
String display = month + " - " + Month.values()[month-1].getDisplayName(TextStyle.FULL, Locale.getDefault());
setName(display);
setDisplayName(display);
}
示例15: BootCPNode
import org.openide.nodes.Children; //導入方法依賴的package包/類
@Messages("BootCPNode_displayName=Java Dependencies")
BootCPNode(Project p) {
super(Children.create(new BootCPChildren(p), false), Lookups.singleton(PathFinders.createPathFinder()));
setName("BootCPNode");
setDisplayName(BootCPNode_displayName());
}