/** Computes a list of FileObjects in the right order * that can represent this instance. * * @param name of resource to find * @return enumeration of FileObject */ Enumeration<FileObject> delegates(final String name) { Enumeration<FileSystem> en = Enumerations.array(systems); // XXX order (stably) by weight class Resources implements Enumerations.Processor<FileSystem, FileObject> { public @Override FileObject process(FileSystem fs, Collection<FileSystem> ignore) { if (fs == null) { return null; } else { return findResourceOn(fs, name); } } } return Enumerations.filter(en, new Resources()); }
/** Creates enumeration of existing subfiles in all tree * of files. * * @param rec should it be recursive or not * @return enumeration of AbstractFolders */ final Enumeration<AbstractFolder> existingSubFiles(boolean rec) { if (!rec) { return Enumerations.array(subfiles()); } else { class P implements org.openide.util.Enumerations.Processor<AbstractFolder, AbstractFolder> { public AbstractFolder process(AbstractFolder af, Collection<AbstractFolder> toAdd) { toAdd.addAll(Arrays.asList(af.subfiles())); return af; } } return Enumerations.queue(Enumerations.singleton(this), new P()); } }
return Enumerations.queue(Enumerations.array(getChildren()), new WithChildren());
/** Get the nodes as an enumeration. * @return enumeration of nodes */ public final Enumeration<Node> nodes() { return Enumerations.array(getNodes()); }
/** Traverse a path from a parent node down, by an enumeration of names. * @param start node to start searching at * @param names names of nodes * along the path * @return the node with such a path from the start node * @exception NodeNotFoundException if the node with such name * does not exists; the exception contains additional information * about the failure. */ public static Node findPath(Node start, String[] names) throws NodeNotFoundException { return findPath(start, Enumerations.array(names)); }
/** Composes two enumerations into one. * @param first first enumeration * @param second second enumeration */ public SeqEn (Enumeration first, Enumeration second) { this (array (new Enumeration[] { first, second })); }
/** Composes two enumerations into one. * @param first first enumeration * @param second second enumeration */ public SeqEn (Enumeration first, Enumeration second) { this (array (new Enumeration[] { first, second })); }
public java.util.Enumeration getLocales() { return Enumerations.array(Locale.getAvailableLocales()); }
/** Get the nodes as an enumeration. * @return enumeration of {@link Node}s */ public final Enumeration nodes () { return org.openide.util.Enumerations.array (getNodes ()); }
/** Get the nodes as an enumeration. * @return enumeration of {@link Node}s */ public final Enumeration nodes () { return org.openide.util.Enumerations.array (getNodes ()); }
/** Traverse a path from a parent node down, by an enumeration of names. * @param start node to start searching at * @param names names of nodes * along the path * @return the node with such a path from the start node * @exception NodeNotFoundException if the node with such name * does not exists; the exception contains additional information * about the failure. */ public static Node findPath (Node start, String[] names) throws NodeNotFoundException { return findPath (start, org.openide.util.Enumerations.array (names)); }
/** Traverse a path from a parent node down, by an enumeration of names. * @param start node to start searching at * @param names names of nodes * along the path * @return the node with such a path from the start node * @exception NodeNotFoundException if the node with such name * does not exists; the exception contains additional information * about the failure. */ public static Node findPath (Node start, String[] names) throws NodeNotFoundException { return findPath (start, org.openide.util.Enumerations.array (names)); }
public Enumeration children() { ensureChildrenInitialized(); return Enumerations.array(children); }
/** Computes a list of FileObjects in the right order * that can represent this instance. * * @param name of resource to find * @return enumeration of FileObject */ Enumeration delegates (final String name) { Enumeration en = org.openide.util.Enumerations.array (systems); class Resources implements org.openide.util.Enumerations.Processor { public Object process (Object obj, Collection ignore) { FileSystem fs = (FileSystem)obj; if (fs == null) { return null; } else { return findResourceOn (fs, name); } } } return org.openide.util.Enumerations.filter (en, new Resources ()); }
/** Computes a list of FileObjects in the right order * that can represent this instance. * * @param name of resource to find * @return enumeration of FileObject */ Enumeration delegates (final String name) { Enumeration en = org.openide.util.Enumerations.array (systems); class Resources implements org.openide.util.Enumerations.Processor { public Object process (Object obj, Collection ignore) { FileSystem fs = (FileSystem)obj; if (fs == null) { return null; } else { return findResourceOn (fs, name); } } } return org.openide.util.Enumerations.filter (en, new Resources ()); }
/** Enumerates all loaders. Loaders are taken from children * structure of NbLoaderPool. */ @Override protected Enumeration<DataLoader> loaders () { if (!listenersRegistered) { initListeners(); } // // prevents from extensive copying // DataLoader[] arr; synchronized (NbLoaderPool.class) { if (loadersArray == null) { List<DataLoader> ldrs = new ArrayList<DataLoader>(loaders); // Since unit tests frequently add a bare DataLoader to default lookup: ldrs.addAll(Lookup.getDefault().lookupAll(DataLoader.class)); loadersArray = ldrs.toArray(new DataLoader[ldrs.size()]); } arr = loadersArray; } return org.openide.util.Enumerations.array (arr); }
/** @return enumeration of all listeners. */ private final Enumeration listeners () { if (listeners == null) { return Enumerations.empty(); } else { return Enumerations.removeNulls ( Enumerations.array (listeners.getAllListeners ()) ); } }
/** @return enumeration of all listeners. */ private final Enumeration listeners () { if (listeners == null) { return Enumerations.empty(); } else { return Enumerations.removeNulls ( Enumerations.array (listeners.getAllListeners ()) ); } }
private void startLoading() { LOG.fine("start loading doc"); //NOI18N Directive[] dirs = Directive.values(); directives = Enumerations.array(dirs); progress = ProgressHandleFactory.createHandle(Bundle.doc_building()); progress.start(dirs.length); buildDoc(); }
/** Creates enumeration of existing subfiles in all tree * of files. * * @param rec should it be recursive or not * @return enumeration of AbstractFolders */ final Enumeration existingSubFiles (boolean rec) { if (!rec) { return Enumerations.array (subfiles ()); } else { class P implements org.openide.util.Enumerations.Processor { public Object process(Object o, Collection toAdd) { AbstractFolder af = (AbstractFolder)o; toAdd.addAll (Arrays.asList (af.subfiles ())); return o; } } return Enumerations.queue ( Enumerations.singleton (this), new P () ); } }