Package org.objectstyle.wolips.jdt.classpath

Examples of org.objectstyle.wolips.jdt.classpath.WOFrameworkClasspathContainer


    if (_frameworkTableViewer != null) {
      Object[] checkedObjects = _frameworkTableViewer.getCheckedElements();
      for (Object checkedObject : checkedObjects) {
        IEclipseFramework selectedFramework = (IEclipseFramework) checkedObject;
        if (!isFrameworkUsed(selectedFramework)) {
          WOFrameworkClasspathContainer frameworkContainer = new WOFrameworkClasspathContainer(selectedFramework);
          classpathEntries.add(JavaCore.newContainerEntry(frameworkContainer.getPath()));
        }
      }
    }
    return classpathEntries.toArray(new IClasspathEntry[classpathEntries.size()]);
  }
View Full Code Here


   
    public static boolean addFrameworkToProject(IEclipseFramework frameworkToAdd, IJavaProject javaProject, List<IClasspathEntry> existingEntries) {
      boolean addFramework = true;
      String name = frameworkToAdd.getName();
      for (IClasspathEntry existingEntry : existingEntries) {
        WOFrameworkClasspathContainer frameworkContainer = WOFrameworkClasspathContainer.getFrameworkClasspathContainer(javaProject, existingEntry);
        if (frameworkContainer != null) {
          IFramework framework = frameworkContainer.getFramework();
          if (framework.getName().equals(name)) {
            addFramework = false;
          }
        }
      }

      if (addFramework) {
        WOFrameworkClasspathContainer newContainer = new WOFrameworkClasspathContainer(frameworkToAdd);
        IClasspathEntry newEntry = JavaCore.newContainerEntry(newContainer.getPath());
        existingEntries.add(newEntry);
      }

      return addFramework;
    }
View Full Code Here

    public static boolean removeFrameworkFromProject(IEclipseFramework frameworkToRemove, IJavaProject javaProject, List<IClasspathEntry> existingEntries) {
      IClasspathEntry removeEntry = null;
      String name = frameworkToRemove.getName();
      for (IClasspathEntry existingEntry : existingEntries) {
        WOFrameworkClasspathContainer frameworkContainer = WOFrameworkClasspathContainer.getFrameworkClasspathContainer(javaProject, existingEntry);
        if (frameworkContainer != null) {
          IFramework framework = frameworkContainer.getFramework();
          if (framework.getName().equals(name)) {
            removeEntry = existingEntry;
          }
        }
      }
View Full Code Here

    public static List<IEclipseFramework> getFrameworks(IJavaProject javaProject) throws JavaModelException {
      FrameworkModel<IEclipseFramework> frameworkModel = JdtPlugin.getDefault().getFrameworkModel(javaProject.getProject());
      List<IEclipseFramework> frameworks = new LinkedList<IEclipseFramework>();
      IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
      for (IClasspathEntry classpathEntry : classpathEntries) {
        WOFrameworkClasspathContainer frameworkContainer = WOFrameworkClasspathContainer.getFrameworkClasspathContainer(javaProject, classpathEntry);
        if (frameworkContainer != null) {
          IEclipseFramework framework = frameworkContainer.getFramework();
          frameworks.add(framework);
        }
        else if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
          IClasspathEntry resolvedClasspathEntry = JavaCore.getResolvedClasspathEntry(classpathEntry);
          File classpathFile = resolvedClasspathEntry.getPath().toFile();
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.jdt.classpath.WOFrameworkClasspathContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.