Search in sources :

Example 11 with IJavaModel

use of org.eclipse.jdt.core.IJavaModel in project mdw-designer by CenturyLinkCloud.

the class ResourceWrapper method getJavaProject.

public IJavaProject getJavaProject() throws JavaModelException {
    IJavaProject javaProject = null;
    IProject project = getProject();
    if (project != null) {
        IJavaModel javaModel = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
        if (javaModel != null)
            javaProject = javaModel.getJavaProject(project.getName());
    }
    return javaProject;
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) IProject(org.eclipse.core.resources.IProject) IJavaModel(org.eclipse.jdt.core.IJavaModel)

Example 12 with IJavaModel

use of org.eclipse.jdt.core.IJavaModel in project mdw-designer by CenturyLinkCloud.

the class ResourceWrapper method getOwningJavaProject.

public IJavaProject getOwningJavaProject() throws JavaModelException {
    IJavaProject javaProject = null;
    IProject owningProject = getOwningProject();
    if (owningProject != null) {
        IJavaModel javaModel = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
        if (javaModel != null)
            javaProject = javaModel.getJavaProject(owningProject.getName());
    }
    return javaProject;
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) IProject(org.eclipse.core.resources.IProject) IJavaModel(org.eclipse.jdt.core.IJavaModel)

Aggregations

IJavaModel (org.eclipse.jdt.core.IJavaModel)12 IJavaProject (org.eclipse.jdt.core.IJavaProject)9 JavaModelException (org.eclipse.jdt.core.JavaModelException)5 IClasspathEntry (org.eclipse.jdt.core.IClasspathEntry)4 IProject (org.eclipse.core.resources.IProject)3 IPath (org.eclipse.core.runtime.IPath)3 IJavaElement (org.eclipse.jdt.core.IJavaElement)3 JavaProject (org.eclipse.jdt.internal.core.JavaProject)3 ArrayList (java.util.ArrayList)2 IFolder (org.eclipse.core.resources.IFolder)2 HashMap (java.util.HashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 IFile (org.eclipse.core.resources.IFile)1 Path (org.eclipse.core.runtime.Path)1 QualifiedName (org.eclipse.core.runtime.QualifiedName)1 IClasspathContainer (org.eclipse.jdt.core.IClasspathContainer)1 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)1 IField (org.eclipse.jdt.core.IField)1 IJavaElementDelta (org.eclipse.jdt.core.IJavaElementDelta)1