本文整理汇总了Java中org.eclipse.core.resources.IContainer.members方法的典型用法代码示例。如果您正苦于以下问题:Java IContainer.members方法的具体用法?Java IContainer.members怎么用?Java IContainer.members使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IContainer
的用法示例。
在下文中一共展示了IContainer.members方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanOutput
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
private void cleanOutput(IProject aProject, OutputConfiguration config, IProgressMonitor monitor)
throws CoreException {
IContainer container = getContainer(aProject, config.getOutputDirectory());
if (!container.exists()) {
return;
}
if (config.isCanClearOutputDirectory()) {
for (IResource resource : container.members()) {
resource.delete(IResource.KEEP_HISTORY, monitor);
}
} else if (config.isCleanUpDerivedResources()) {
List<IFile> resources = derivedResourceMarkers.findDerivedResources(container, null);
for (IFile iFile : resources) {
iFile.delete(IResource.KEEP_HISTORY, monitor);
}
}
}
示例2: getGraphModels
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* Retrieve the graph models contained in the container
*
* @param container
* @param models
* @throws CoreException
*/
public static void getGraphModels(IContainer container, List<IFile> models) throws CoreException {
if (!container.exists())
return;
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer)
getGraphModels((IContainer) member, models);
else if (member instanceof IFile) {
IFile file = (IFile) member;
if (PreferenceManager.isGraphModelFile(file))
models.add(file);
if (PreferenceManager.isGW3ModelFile(file))
models.add(file);
if (PreferenceManager.isJSONModelFile(file))
models.add(file);
}
}
}
示例3: processContainer
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param container
* @param path
* @return
* @throws CoreException
*/
private static IFile processContainer(IContainer container, String path) throws CoreException {
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
IFile file = processContainer((IContainer) member, path);
if (file != null) {
IPath p = ResourceManager.getPathWithinPackageFragment(file); // avoid
// file
// within
// classes
// directory
if (p != null)
return file;
}
} else if (member instanceof IFile) {
IFile ifile = (IFile) member;
if (ifile.getFullPath().toString().endsWith(path)) {
return ifile;
}
}
}
return null;
}
示例4: getAllJUnitResultFiles
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param container
* @param files
* @throws CoreException
*/
public static void getAllJUnitResultFiles(String projectName, List<IFile> files) throws CoreException {
if (projectName == null)
return;
IContainer container = ResourceManager.getProject(projectName);
container.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IFile) {
IFile file = (IFile) member;
if (isJUnitResultFile(file)) {
files.add(file);
}
}
}
}
示例5: resourceExistsIn
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* Process recursively the containers until we found a resource with the
* specified path
*
* @param container
* @param path
* @return
* @throws CoreException
*/
private static boolean resourceExistsIn(IContainer container, IPath path) throws CoreException {
boolean found = false;
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
found = resourceExistsIn((IContainer) member, path);
if (found)
break;
} else if (member instanceof IFile) {
IFile file = (IFile) member;
if (path.equals(file.getFullPath()))
return true;
}
}
return found;
}
示例6: renameFile
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param container
* @param filename
* @throws CoreException
*/
public static void renameFile(IContainer container, String oldName, String newName) throws CoreException {
if (oldName.equals(newName))
return;
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
renameFile((IContainer) member, oldName, newName);
} else if (member instanceof IFile) {
IFile file = (IFile) member;
if (file.getName().equals(oldName)) {
IProgressMonitor monitor = new NullProgressMonitor();
IPath path = file.getFullPath().removeLastSegments(1).append(newName);
ResourceManager.logInfo(file.getProject().getName(),
"Renaming " + file.getFullPath() + " into " + path);
file.copy(path, true, monitor);
file.delete(true, monitor);
}
}
}
}
示例7: deleteCache
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param projectName
* @param container
* @param monitor
*/
private static void deleteCache(String cachename, IContainer container, IProgressMonitor monitor) {
try {
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
deleteCache(cachename, (IContainer) member, monitor);
} else if (member instanceof IFile) {
IFile file = (IFile) member;
if (cachename.equals(file.getName())) {
file.delete(true, monitor);
}
}
}
} catch (CoreException e) {
ResourceManager.logException(e);
}
}
示例8: collectResource
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
private void collectResource(IContainer container, Set<IFile> collected) {
try {
IResource[] resources = container.members(IContainer.EXCLUDE_DERIVED);
for (IResource resource : resources) {
collectRelevantFiles(resource, collected);
}
} catch (CoreException c) {
LOGGER.warn("Error while collecting files", c);
}
}
示例9: getAllGraphFiles
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param container
* @param files
* @throws CoreException
*/
public static void getAllGraphFiles(IContainer container, List<IFile> files) throws CoreException {
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
getAllGraphFiles((IContainer) member, files);
} else if (member instanceof IFile) {
IFile file = (IFile) member;
if (PreferenceManager.isGraphModelFile(file))
files.add(file);
}
}
}
示例10: getAllWorkBookFiles
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
public static void getAllWorkBookFiles(String projectName, List<IFile> files) throws CoreException {
if (projectName == null)
return;
IContainer container = ResourceManager.getProject(projectName);
container.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IFile) {
IFile file = (IFile) member;
if (isWorkBookFile(file)) {
files.add(file);
}
}
}
}
示例11: deleteFile
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
/**
* @param filename
* @throws CoreException
*/
public static void deleteFile(IContainer container, String filename) throws CoreException {
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
deleteFile((IContainer) member, filename);
} else if (member instanceof IFile) {
IFile file = (IFile) member;
if (file.getName().equals(filename)) {
file.delete(true, new NullProgressMonitor());
}
}
}
}
示例12: findAllEMFFiles
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
private void findAllEMFFiles(final IContainer container) throws CoreException {
final IResource[] members = container.members();
for (final IResource member : members) {
if (member instanceof IContainer) {
if (member.isAccessible()) {
findAllEMFFiles((IContainer) member);
}
} else if (member instanceof IFile) {
final IFile file = (IFile) member;
if (file.getFileExtension().equals("ecore")) {
allEcoreFiles.put(file.getName(), file);
}
}
}
}
示例13: findAllXMIFiles
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
private void findAllXMIFiles(final IContainer container) throws CoreException {
final IResource[] members = container.members();
for (final IResource member : members) {
if (member instanceof IContainer) {
if (member.isAccessible()) {
findAllXMIFiles((IContainer) member);
}
} else if (member instanceof IFile) {
final IFile file = (IFile) member;
allFiles.put(file.getName(), file);
}
}
}
示例14: existsFileAnyCase
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
protected String existsFileAnyCase(String fileName) {
if ((getContainerFullPath() != null)
&& (getContainerFullPath().isEmpty() == false)
&& (fileName.compareTo("") != 0)) //$NON-NLS-1$
{
// look through all resources at the specified container -
// compare in upper case
IResource parent = ResourcesPlugin.getWorkspace().getRoot()
.findMember(getContainerFullPath());
if (parent instanceof IContainer) {
IContainer container = (IContainer) parent;
try {
IResource[] members = container.members();
String enteredFileUpper = fileName.toUpperCase();
for (int i = 0; i < members.length; i++) {
String resourceUpperName = members[i].getName()
.toUpperCase();
if (resourceUpperName.equals(enteredFileUpper)) {
return members[i].getName();
}
}
} catch (CoreException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
}
return null;
}
示例15: loadModels
import org.eclipse.core.resources.IContainer; //导入方法依赖的package包/类
private static List<String> loadModels(IContainer container) throws CoreException {
List<String> files = new ArrayList<String>();
IResource[] members = container.members();
for (IResource member : members) {
if (member instanceof IContainer) {
files.addAll(loadModels((IContainer) member));
} else if (member instanceof IFile) {
if (member.getFileExtension() != null && member.getFileExtension().equals("xmontiarc")) {
String path = member.getFullPath().toOSString();
files.add(path);
}
}
}
return files;
}