本文整理匯總了Java中org.eclipse.core.resources.IResource.ROOT屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResource.ROOT屬性的具體用法?Java IResource.ROOT怎麽用?Java IResource.ROOT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResource
的用法示例。
在下文中一共展示了IResource.ROOT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
if (resource == null) {
return false;
}
switch (resource.getType()) {
case IResource.ROOT:
case IResource.PROJECT:
case IResource.FOLDER:
return true;
case IResource.FILE:
IFile file = (IFile) resource;
if (EditorConfigConstants.EDITORCONFIG.equals(file.getName())
&& delta.getKind() == IResourceDelta.CHANGED) {
entries.remove(new FileResource(file));
}
}
return false;
}
示例2: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta.getResource().getType() == IResource.ROOT) {
List<IProject> projects = getProjects(event.getDelta());
// do something with new projects
for (IProject project : projects) {
try {
triggerBuild(project);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
}
示例3: visit
@Override
public boolean visit(IResourceDelta delta) throws CoreException
{
if( delta != null )
{
final IResource resource = delta.getResource();
if( !resource.isDerived() )
{
switch( resource.getType() )
{
case IResource.ROOT:
return true;
case IResource.PROJECT: {
IProject project = (IProject) resource;
int kind = delta.getKind();
int flags = delta.getFlags();
if( isInterestingProject(project)
&& (kind == IResourceDelta.ADDED || (flags & IResourceDelta.OPEN) != 0 || (kind == IResourceDelta.CHANGED
&& (flags & IResourceDelta.DESCRIPTION) != 0 && !isProjectKnown(project))) )
{
createModel(project, true);
return false;
}
else if( kind == IResourceDelta.REMOVED )
{
removeModel(project);
return false;
}
return true;
}
case IResource.FOLDER:
return isInterestingFolder((IFolder) resource);
case IResource.FILE:
// do not process
if( isContentChange(delta) )
{
handleFileDelta(delta);
return false;
}
}
}
}
return false;
}