Package org.eclipse.jdt.internal.ui.wizards

Examples of org.eclipse.jdt.internal.ui.wizards.ClassPathDetector


    if (!project.getFile(CLASSPATH).exists()) {
      ArrayList<IClasspathEntry> classpath = new ArrayList<IClasspathEntry>();
      boolean source = false;
      boolean container = false;

      ClassPathDetector detector = new ClassPathDetector(project, null);
      for (IClasspathEntry entry : detector.getClasspath()){
        if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){
          source = true;
        } else if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER){
          container = true;
        }
        classpath.add(entry);
      }

      // default source folder
      if (!source){
        IResource src;
        IPreferenceStore store = PreferenceConstants.getPreferenceStore();
        String name = store.getString(PreferenceConstants.SRCBIN_SRCNAME);
        boolean srcBinFolders = store.getBoolean(
            PreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ);
        if (srcBinFolders && name.length() > 0) {
          src = javaProject.getProject().getFolder(name);
        } else {
          src = javaProject.getProject();
        }

        classpath.add(
            new CPListElement(
              javaProject, IClasspathEntry.CPE_SOURCE, src.getFullPath(), src)
            .getClasspathEntry());

        File srcPath = new File(
            ProjectUtils.getFilePath(project, src.getFullPath().toString()));
        if (!srcPath.exists()){
          srcPath.mkdirs();
        }
      }

      // default containers
      if (!container){
        for (IClasspathEntry entry : PreferenceConstants.getDefaultJRELibrary()){
          classpath.add(entry);
        }
      }

      // dependencies on other projects
      for (IClasspathEntry entry : createOrUpdateDependencies(javaProject, depends)){
        classpath.add(entry);
      }

      javaProject.setRawClasspath(
          classpath.toArray(new IClasspathEntry[classpath.size()]), null);

      // output location
      IPath output = detector.getOutputLocation();
      if (output == null){
        output = BuildPathsBlock.getDefaultOutputLocation(javaProject);
      }
      javaProject.setOutputLocation(output, null);
    }
View Full Code Here


      IPath outputLocation= null;
      IProject project= javaProject.getProject();

      if (fKeepContent) {
        if (!project.getFile(FILENAME_CLASSPATH).exists()) {
          final ClassPathDetector detector= new ClassPathDetector(fCurrProject, new SubProgressMonitor(monitor, 2));
          entries= detector.getClasspath();
          outputLocation= detector.getOutputLocation();
          if (entries.length == 0)
            entries= null;
        } else {
          monitor.worked(2);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.ui.wizards.ClassPathDetector

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.