Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.segmentCount()


          return status;
        break;

      // project entry check
      case IClasspathEntry.CPE_PROJECT :
        if (path.isAbsolute() && path.segmentCount() == 1) {
          IProject prereqProjectRsc = workspaceRoot.getProject(path.segment(0));
          IJavaProject prereqProject = JavaCore.create(prereqProjectRsc);
          try {
            if (!prereqProjectRsc.exists() || !prereqProjectRsc.hasNature(JavaCore.NATURE_ID)){
              return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_unboundProject, new String[] {path.segment(0), projectName}));
View Full Code Here


    for (Enumeration zipEntries = zipFile.entries();
        zipEntries.hasMoreElements();) {
      ZipEntry zipEntry = (ZipEntry)zipEntries.nextElement();
      IPath entryPath = new Path(zipEntry.getName());
      if (entryPath.segmentCount() <= pathLength) {
        // ancestor or current directory
        continue;
      }
     
      if (!filePath.isPrefixOf(entryPath)) {
View Full Code Here

      if (!filePath.isPrefixOf(entryPath)) {
        // Not a descendant.
        continue;
      }
     
      if (entryPath.segmentCount() == pathLength + 1) {
        childZipEntries.put(zipEntry.getName(), zipEntry);
      } else {
        String name = entryPath.uptoSegment(pathLength + 1).
          addTrailingSeparator().toString();
       
View Full Code Here

   
    if (sourceFolder != null) {
      path = sourceFolder.getProjectRelativePath().append(path);
    }

    for (int ii = 1; ii <= path.segmentCount(); ii++) {
      IPath subpath = path.uptoSegment(ii);
      IFolder subfolder = project.getFolder(subpath);
     
      if (subfolder.exists() == false) {
        subfolder.create(true, true, monitor);
View Full Code Here

        IPath result = null;
        int maxSegments = 0;
        for (Entry<IPath, IPath> entry : outEntries) {
            IPath srcRoot = entry.getKey();
            int firstSegments = srcPath.matchingFirstSegments(srcRoot);
            if (firstSegments > maxSegments && firstSegments == srcRoot.segmentCount()) {
                maxSegments = firstSegments;
                result = srcRoot;
            }
        }
        return result;
View Full Code Here

        // Get the policy source path
        IProject project = projectProvider.getProject();
        IPath policySourcePath = getPolicySourcePath(project);

        int startIndex = policySourcePath.segmentCount() + 1;
        StringBuffer ref = new StringBuffer("/").append(segments[startIndex]);

        int i = startIndex + 1;
        while (i < segments.length) {
            //Literal forward slash is used and not File.separatorChar
View Full Code Here

        IProject project = projectProvider.getProject();
        IPath policySourcePath =
                MCSProjectNature.getMCSProjectNature(project).
                getPolicySourcePath();

        int startIndex = policySourcePath.segmentCount() + 1;
        StringBuffer ref = new StringBuffer("/").append(segments[startIndex]);

        int i = startIndex + 1;
        while (i < segments.length) {
            //Literal forward slash is used and not File.separatorChar
View Full Code Here

        super.init(site, input);
        getSite().getPage().addSelectionListener(this);
        FileEditorInput fileInput = (FileEditorInput) input;
        this.definitionFile = fileInput.getFile();
        IPath path = fileInput.getPath().removeLastSegments(1);
        path = path.removeFirstSegments(path.segmentCount() - 1);
        setPartName(path.lastSegment());
        definition = ProcessCache.getProcessDefinition(definitionFile);
        definition.setDirty(false);
        ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
        definition.addPropertyChangeListener(this);
View Full Code Here

     * @throws JavaModelException
     */
    private static String contributionLocation(IJavaProject javaProject) throws MalformedURLException, JavaModelException {
        IPath location = javaProject.getOutputLocation();
        IResource resource;
        if (location.segmentCount() == 1) {
            resource = javaProject.getProject();
        } else {
            resource = javaProject.getProject().getWorkspace().getRoot().getFolder(location);
        }
        location = resource.getLocation();
View Full Code Here

    }

    if (baselocation != null) {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baselocation);
      if (filePath.segmentCount() > 0) {
        resource = root.getFile(filePath);
      }
    }
    return resource;
  }
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.