本文整理匯總了Java中org.openide.filesystems.FileUtil.getOrder方法的典型用法代碼示例。如果您正苦於以下問題:Java FileUtil.getOrder方法的具體用法?Java FileUtil.getOrder怎麽用?Java FileUtil.getOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.filesystems.FileUtil
的用法示例。
在下文中一共展示了FileUtil.getOrder方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadChildren
import org.openide.filesystems.FileUtil; //導入方法依賴的package包/類
private static void loadChildren(FileObject folder) {
List<FileObject> kids = new ArrayList<FileObject>();
for (DataObject kid : DataFolder.findFolder(folder).getChildren()) {
kids.add(kid.getPrimaryFile());
}
FileUtil.getOrder(kids, true);
}
示例2: loadCategories
import org.openide.filesystems.FileUtil; //導入方法依賴的package包/類
private static List<Category> loadCategories () {
FileObject[] categoryFOs = FileUtil.getConfigFile(SEARCH_PROVIDERS_FOLDER).getChildren();
// respect ordering defined in layers
List<FileObject> sortedCats = FileUtil.getOrder(Arrays.asList(categoryFOs), false);
List<ProviderModel.Category> categories = new ArrayList<ProviderModel.Category>(sortedCats.size());
for (FileObject curFO : sortedCats) {
String displayName = null;
try {
displayName = curFO.getFileSystem().getDecorator().annotateName(
curFO.getNameExt(), Collections.singleton(curFO));
} catch (FileStateInvalidException ex) {
Logger.getLogger(ProviderModel.class.getName()).log(Level.WARNING,
"Obtaining display name for " + curFO + " failed.", ex);
}
String commandPrefix = null;
Object cpAttr = curFO.getAttribute(COMMAND_PREFIX);
if (cpAttr instanceof String) {
commandPrefix = (String)cpAttr;
}
categories.add(new Category(curFO, displayName, commandPrefix));
}
return categories;
}
示例3: order
import org.openide.filesystems.FileUtil; //導入方法依賴的package包/類
private static List<FOItem> order(List<FOItem> items) {
Map<FileObject,FOItem> m = new LinkedHashMap<FileObject,FOItem>();
for (FOItem item : items) {
m.put(item.fo, item);
}
List<FileObject> files = FileUtil.getOrder(m.keySet(), true);
List<FOItem> r = new ArrayList<FOItem>(files.size());
for (FileObject f : files) {
r.add(m.get(f));
}
return r;
}
示例4: sortedFOs
import org.openide.filesystems.FileUtil; //導入方法依賴的package包/類
private static List<FileObject> sortedFOs(Enumeration<? extends FileObject> fos) {
List<FileObject> list = new ArrayList();
while(fos.hasMoreElements()) list.add(fos.nextElement());
return FileUtil.getOrder(list, false);
}
示例5: sort
import org.openide.filesystems.FileUtil; //導入方法依賴的package包/類
private static List<FileObject> sort( FileObject[] children ) {
List<FileObject> fos = Arrays.asList(children);
fos = FileUtil.getOrder(fos, true);
return fos;
}