List of usage examples for org.eclipse.jdt.core IJavaProject isOnClasspath
boolean isOnClasspath(IResource resource);
From source file:org.summer.dsl.model.types.access.jdt.WorkingCopyOwnerProvider.java
License:Open Source License
protected boolean isOnClassPath(IJavaProject javaProject, IStorage storage) { if (storage instanceof IJarEntryResource) { javaProject.isOnClasspath(((IJarEntryResource) storage).getPackageFragmentRoot()); }//w w w. ja va 2s .c om if (storage instanceof IResource) { return javaProject.isOnClasspath((IResource) storage); } return false; }
From source file:potes.cucumberjvm.eclipseplugin.CucumberLanguage.java
License:Apache License
public Set<String> getCucumberDefinitionPackages(IJavaProject javaProject) throws JavaModelException { Set<String> packages = new HashSet<String>(); for (IType type : getStepDefinitionTypes()) { IResource underlyingResource = type.getUnderlyingResource(); if ((underlyingResource != null && javaProject.isOnClasspath(underlyingResource)) || javaProject.isOnClasspath(type)) { String fqn = type.getFullyQualifiedName(); if (fqn.contains(".")) { packages.add(fqn.substring(0, fqn.lastIndexOf('.'))); } else { packages.add(""); }/* ww w. ja va 2 s . com*/ } } packages.addAll(extraPackages); return packages; }