Examples of IProject


Examples of org.eclipse.core.resources.IProject

          }
          if  (rootInfo != null && rootInfo.project.getProject().equals(resource)){
            element = rootInfo.project;
            break;
          }
          IProject proj = (IProject)resource;
          if (JavaProject.hasJavaNature(proj)) {
            element = JavaCore.create(proj);
          } else {
            // java project may have been been closed or removed (look for
            // element amongst old java project s list).
            element =  this.state.findJavaProject(proj.getName());
          }
        }
        break;
      case IJavaElement.PACKAGE_FRAGMENT_ROOT:
        element = rootInfo == null ? JavaCore.create(resource) : rootInfo.getPackageFragmentRoot(resource);
View Full Code Here

Examples of org.eclipse.core.resources.IProject

          break;
        case IJavaElement.JAVA_MODEL :
          Iterator projectNames = this.state.getOldJavaProjecNames().iterator();
          while (projectNames.hasNext()) {
            String projectName = (String) projectNames.next();
            IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
            if (!JavaProject.hasJavaNature(project)) {
              // project is not accessible or has lost its Java nature
              continue;
            }
            javaProject = (JavaProject) JavaCore.create(project);
            try {
              classpath = javaProject.getResolvedClasspath();
            } catch (JavaModelException e2) {
              // project doesn't exist -> ignore
              continue;
            }
            for (int k = 0, cpLength = classpath.length; k < cpLength; k++){
              if (classpath[k].getEntryKind() == IClasspathEntry.CPE_LIBRARY){
                archivePathsToRefresh.add(classpath[k].getPath());
              }
            }
          }
          break;
      }
    }
   
    // perform refresh
    Iterator projectNames = this.state.getOldJavaProjecNames().iterator();
    IWorkspaceRoot wksRoot = ResourcesPlugin.getWorkspace().getRoot();
    while (projectNames.hasNext()) {
     
      if (monitor != null && monitor.isCanceled()) break;
     
      String projectName = (String) projectNames.next();
      IProject project = wksRoot.getProject(projectName);
      if (!JavaProject.hasJavaNature(project)) {
        // project is not accessible or has lost its Java nature
        continue;
      }
      JavaProject javaProject = (JavaProject) JavaCore.create(project);
      IClasspathEntry[] entries;
      try {
        entries = javaProject.getResolvedClasspath();
      } catch (JavaModelException e1) {
        // project does not exist -> ignore
        continue;
      }
      for (int j = 0; j < entries.length; j++){
        if (entries[j].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
         
          IPath entryPath = entries[j].getPath();
         
          if (!archivePathsToRefresh.contains(entryPath)) continue; // not supposed to be refreshed
         
          String status = (String)externalArchivesStatus.get(entryPath);
          if (status == null){
           
            // compute shared status
            Object targetLibrary = JavaModel.getTarget(wksRoot, entryPath, true);
   
            if (targetLibrary == null){ // missing JAR
              if (this.state.getExternalLibTimeStamps().remove(entryPath) != null){
                externalArchivesStatus.put(entryPath, EXTERNAL_JAR_REMOVED);
                // the jar was physically removed: remove the index
                this.manager.indexManager.removeIndex(entryPath);
              }
   
            } else if (targetLibrary instanceof File){ // external JAR
   
              File externalFile = (File)targetLibrary;
             
              // check timestamp to figure if JAR has changed in some way
              Long oldTimestamp =(Long) this.state.getExternalLibTimeStamps().get(entryPath);
              long newTimeStamp = getTimeStamp(externalFile);
              if (oldTimestamp != null){
   
                if (newTimeStamp == 0){ // file doesn't exist
                  externalArchivesStatus.put(entryPath, EXTERNAL_JAR_REMOVED);
                  this.state.getExternalLibTimeStamps().remove(entryPath);
                  // remove the index
                  this.manager.indexManager.removeIndex(entryPath);
   
                } else if (oldTimestamp.longValue() != newTimeStamp){
                  externalArchivesStatus.put(entryPath, EXTERNAL_JAR_CHANGED);
                  this.state.getExternalLibTimeStamps().put(entryPath, new Long(newTimeStamp));
                  // first remove the index so that it is forced to be re-indexed
                  this.manager.indexManager.removeIndex(entryPath);
                  // then index the jar
                  this.manager.indexManager.indexLibrary(entryPath, project.getProject());
                } else {
                  externalArchivesStatus.put(entryPath, EXTERNAL_JAR_UNCHANGED);
                }
              } else {
                if (newTimeStamp == 0){ // jar still doesn't exist
                  externalArchivesStatus.put(entryPath, EXTERNAL_JAR_UNCHANGED);
                } else {
                  externalArchivesStatus.put(entryPath, EXTERNAL_JAR_ADDED);
                  this.state.getExternalLibTimeStamps().put(entryPath, new Long(newTimeStamp));
                  // index the new jar
                  this.manager.indexManager.indexLibrary(entryPath, project.getProject());
                }
              }
            } else { // internal JAR
              externalArchivesStatus.put(entryPath, INTERNAL_JAR_IGNORE);
            }
View Full Code Here

Examples of org.eclipse.core.resources.IProject

        IResource res = delta.getResource();
       
        // find out the element type
        RootInfo rootInfo = null;
        int elementType;
        IProject proj = (IProject)res;
        boolean wasJavaProject = this.state.findJavaProject(proj.getName()) != null;
        boolean isJavaProject = JavaProject.hasJavaNature(proj);
        if (!wasJavaProject && !isJavaProject) {
          elementType = NON_JAVA_RESOURCE;
        } else {
          rootInfo = this.enclosingRootInfo(res.getFullPath(), delta.getKind());
View Full Code Here

Examples of org.locationtech.udig.project.IProject

        setWindowTitle(Messages.ExportProjectWizard_Title);
        setNeedsProgressMonitor(true);
        selectionPage = new ExportSelectionPage(Messages.ExportSelectionPage_Destination,
                Messages.ExportProjectWizard_Destination2, wizardPageIconDescriptor);
        Object selectionObj = selection.getFirstElement();
        IProject project = null;
        if (selectionObj instanceof MapImpl) {
            MapImpl map = (MapImpl) selectionObj;
            project = map.getProject();
        }
        if (selectionObj instanceof IProject) {
            project = (IProject) selectionObj;
        }
        if (project != null) {
            selectionPage.selectProject(project.getID().toString());
        }
        this.selection = selection;
    }
View Full Code Here

Examples of uk.ac.osswatch.simal.model.IProject

 
 
  @Test
  public void testProjectImport() throws FileNotFoundException, IOException, SimalRepositoryException, DuplicateURIException {
    Iterator<IProject> projects = repo.getAllProjects().iterator();
    IProject project;
   
    boolean projectAIsValid = false;
    while (projects.hasNext()) {
      project = projects.next();
      String name = project.getName();
      Set<IDocument> homepages = project.getHomepages();
      if (name.equals("Project A")) {
        if (!homepages.toString().contains("Homepage")) {
          break;
        }
        projectAIsValid = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.