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