List of usage examples for org.eclipse.jdt.core IJavaProject getRequiredProjectNames
String[] getRequiredProjectNames() throws JavaModelException;
From source file:org.swingexplorer.eclipseplugin.ActOpenSourceLine.java
License:Open Source License
private IType internalFindType(IJavaProject project, String className, Set<IJavaProject> visitedProjects) throws JavaModelException { if (visitedProjects.contains(project)) return null; IType type = project.findType(className, (IProgressMonitor) null); if (type != null) return type; // fix for bug 87492: visit required projects explicitly to also find // not exported types visitedProjects.add(project);//from w ww .jav a 2 s . c om IJavaModel javaModel = project.getJavaModel(); String[] requiredProjectNames = project.getRequiredProjectNames(); for (int i = 0; i < requiredProjectNames.length; i++) { IJavaProject requiredProject = javaModel.getJavaProject(requiredProjectNames[i]); if (requiredProject.exists()) { type = internalFindType(requiredProject, className, visitedProjects); if (type != null) return type; } } return null; }
From source file:projectdependencies.views.ViewContentProviderJdt.java
License:Open Source License
private List<IJavaProject> getRefs(IJavaProject projparam) throws JavaModelException { String[] projNames;//from w ww. j a v a2s .c o m projNames = projparam.getRequiredProjectNames(); List<IJavaProject> refs = new ArrayList<IJavaProject>(); for (String name : projNames) { IJavaProject proj = javaModel.getJavaProject(name); refs.add(proj); } return refs; }
From source file:projectdependencies.views.ViewContentProviderJdt.java
License:Open Source License
@Override public boolean hasChildren(final Object parent) { if (parent instanceof IWorkspaceRoot) return true; Object project = parent;// w w w . j a va 2 s . co m if (project instanceof DepInfo) { project = ((DepInfo) parent).to; } if (project instanceof IJavaProject) { try { IJavaProject proj = (IJavaProject) project; return proj.getRequiredProjectNames().length != 0; } catch (JavaModelException e) { e.printStackTrace(); } } return false; }