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