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


Java IProject.isAccessible方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IProject.isAccessible方法的典型用法代碼示例。如果您正苦於以下問題:Java IProject.isAccessible方法的具體用法?Java IProject.isAccessible怎麽用?Java IProject.isAccessible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IProject的用法示例。


在下文中一共展示了IProject.isAccessible方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDirectExternalDependencyIds

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
 * Returns with all external project dependency project ID for a particular non-external, accessible project.
 */
private Iterable<String> getDirectExternalDependencyIds(final IProject project) {

	if (null == project || !project.isAccessible()) {
		return emptyList();
	}

	IN4JSProject n4Project = core.findProject(URI.createPlatformResourceURI(project.getName(), true)).orNull();
	if (null == n4Project || !n4Project.exists() || n4Project.isExternal()) {
		return emptyList();
	}

	return from(n4Project.getAllDirectDependencies())
			.filter(IN4JSProject.class)
			.filter(p -> p.exists() && p.isExternal())
			.transform(p -> p.getProjectId());
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:20,代碼來源:ExternalProjectsCollector.java

示例2: decorate

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof IResource) {
        IResource res = (IResource) element;
        IProject proj = res.getProject();
        try {
            if (proj != null && proj.isAccessible() && proj.hasNature(NATURE.ID)) {
                IMarker[] markers = res.findMarkers(MARKER.ERROR, false,
                        IResource.DEPTH_INFINITE);
                if (markers.length > 0) {
                    decoration.addOverlay(PlatformUI.getWorkbench().getSharedImages()
                            .getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR));
                }
            }
        } catch (CoreException e) {
            Log.log(e);
        }
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:20,代碼來源:PgDecorator.java

示例3: getProjectMap

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
 * Obtient la map Project vers Projet Java du workspace courant.
 * 
 * @return Map des projets.
 */
public static JavaProjectMap getProjectMap() {
	JavaProjectMap projects = new JavaProjectMap();

	/* Racine du workspace courant. */
	IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();

	/* Parcourt les projets de la racine. */
	for (IProject project : wsRoot.getProjects()) {

		/* Vérication que le projet est un projet Java accessible. */
		if (!project.isAccessible() || !JdtUtils.isJavaProject(project)) {
			continue;
		}

		/* Obtient l'AST du projet. */
		IJavaProject javaProject = JavaCore.create(project);
		projects.put(project, javaProject);
	}
	return projects;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:26,代碼來源:ResourceUtils.java

示例4: getLocation

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
public URI getLocation(URI projectURI, ProjectReference projectReference,
		N4JSSourceContainerType expectedN4JSSourceContainerType) {

	if (projectURI.segmentCount() >= DIRECT_RESOURCE_IN_PROJECT_SEGMENTCOUNT) {
		String expectedProjectName = projectReference.getProject().getProjectId();
		if (expectedProjectName != null && expectedProjectName.length() > 0) {
			IProject existingProject = workspace.getProject(expectedProjectName);
			if (existingProject.isAccessible()) {
				if (expectedN4JSSourceContainerType == N4JSSourceContainerType.ARCHIVE) {
					return null;
				} else {
					return URI.createPlatformResourceURI(expectedProjectName, true);
				}
			} else if (expectedN4JSSourceContainerType == N4JSSourceContainerType.ARCHIVE) {
				for (String libFolder : getLibraryFolders(projectURI)) {
					IFile archiveFile = workspace.getFile(new Path(projectURI.segment(1) + "/" + libFolder
							+ "/"
							+ expectedProjectName
							+ IN4JSArchive.NFAR_FILE_EXTENSION_WITH_DOT));
					if (archiveFile.exists()) {
						return URI.createPlatformResourceURI(archiveFile.getFullPath().toString(), true);
					}
				}
			}
		}
	}
	return null;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:30,代碼來源:EclipseBasedN4JSWorkspace.java

示例5: getProject

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private IProject getProject(BuildData buildData) {
	IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(buildData.getProjectName());
	if (null == project || !project.isAccessible()) {
		final IProject externalProject = getExternalLibraryWorkspace().getProject(buildData.getProjectName());
		if (null != externalProject && externalProject.exists()) {
			project = externalProject;
		}
	}
	return project;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:11,代碼來源:N4JSGenerateImmediatelyBuilderState.java

示例6: getAllNpmProjectsMapping

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
 * A map of project (npm package) names to project location mappings.
 */
private Map<String, URI> getAllNpmProjectsMapping() {
	final URI nodeModulesLocation = locationProvider.getTargetPlatformNodeModulesLocation();
	final Map<String, URI> mappings = newHashMap();

	// Intentionally might include projects that are already in the workspace
	for (final IProject project : externalLibraryWorkspace.getProjects(nodeModulesLocation)) {
		if (project.isAccessible() && project instanceof ExternalProject) {
			final URI location = ((ExternalProject) project).getExternalResource().toURI();
			mappings.put(project.getName(), location);
		}
	}

	return ImmutableMap.copyOf(mappings);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:18,代碼來源:NpmManager.java

示例7: loadAllComponentTypes

import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private static List<String> loadAllComponentTypes() throws CoreException {
	List<String> files = new ArrayList<String>();
	for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
		if (project.isAccessible() && project.isOpen()) {
			files.addAll(loadModels(project));
		}
	}
	return files;
}
 
開發者ID:awortmann,項目名稱:xmontiarc,代碼行數:10,代碼來源:DesignerHelper.java


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