本文整理汇总了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;
}