本文整理汇总了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;
}