本文整理汇总了Java中org.eclipse.core.resources.IWorkspaceRoot.findContainersForLocation方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkspaceRoot.findContainersForLocation方法的具体用法?Java IWorkspaceRoot.findContainersForLocation怎么用?Java IWorkspaceRoot.findContainersForLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IWorkspaceRoot
的用法示例。
在下文中一共展示了IWorkspaceRoot.findContainersForLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllResourcesForLocation
import org.eclipse.core.resources.IWorkspaceRoot; //导入方法依赖的package包/类
@Override
public IResource[] getAllResourcesForLocation(
final IPath location,
final IWorkspaceRoot root,
final boolean mustExist) {
IContainer[] containers = root.findContainersForLocation(location);
if (mustExist && containers != null) {
final List<IContainer> existingContainers = new ArrayList<IContainer>();
for (int i = 0; i < containers.length; i++) {
if (containers[i].exists()) {
existingContainers.add(containers[i]);
}
}
containers = existingContainers.toArray(new IContainer[existingContainers.size()]);
}
return containers;
}
示例2: LocationInfo
import org.eclipse.core.resources.IWorkspaceRoot; //导入方法依赖的package包/类
public LocationInfo(final IPath location) {
Check.notNull(location, "location"); //$NON-NLS-1$
this.location = location;
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
file = root.getFileForLocation(location);
container = root.getContainerForLocation(location);
files = root.findFilesForLocation(location);
containers = root.findContainersForLocation(location);
}