本文整理匯總了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);
}