當前位置: 首頁>>代碼示例>>Java>>正文


Java IResource.ROOT屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:20,代碼來源:IDEEditorConfigManager.java

示例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();
			}
		}
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:15,代碼來源:ProjectListener.java

示例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;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:46,代碼來源:WorkspaceModelManager.java


注:本文中的org.eclipse.core.resources.IResource.ROOT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。