Package org.eclipse.core.runtime

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


  private String getRelativeLocation(String target, String base) {
    IPath targetPath = Path.fromOSString(target);
    IPath basePath = Path.fromPortableString(base);
    IPath result = targetPath.makeRelativeTo(basePath);
    // TODO remove the first part! Should be correct in first place!
    result = result.removeFirstSegments(1);
    return result.toPortableString();
  }

  private void configureExtensions(RutaBuildOptions options) {
    ConfigurationParameterSettings configurationParameterSettings = analysisEngineDescription
View Full Code Here


          String startPart, int type, String complString) {
    Collection<String> types = new HashSet<String>();
    if (type == RutaTypeConstants.RUTA_TYPE_AT) {
      try {
        IPath path = sourceModule.getModelElement().getPath();
        path = path.removeFirstSegments(2);
        types = importTypeSystem(path.toPortableString(), sourceModule.getModelElement()
                .getScriptProject().getProject());
      } catch (Exception e) {
      }
      for (String string : types) {
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

        if (isImplCreation)
          packageFragmentPath = packageFragmentPath.append("server");//$NON-NLS-1$
        else
          packageFragmentPath = packageFragmentPath.append("client");//$NON-NLS-1$

        IFolder folder = javaProject.getProject().getFolder(packageFragmentPath.removeFirstSegments(1));
        if (!folder.exists())
          folder.create(true, true, null);
        packageFragment = javaProject.findPackageFragment(packageFragmentPath);
      } catch (Exception e) {
        Activator.logException(e);
View Full Code Here

        if (isImplCreation)
          packageFragmentPath = packageFragmentPath.append("server");//$NON-NLS-1$
        else
          packageFragmentPath = packageFragmentPath.append("client");//$NON-NLS-1$

        IFolder folder = javaProject.getProject().getFolder(packageFragmentPath.removeFirstSegments(1));
        if (!folder.exists())
          folder.create(true, true, null);
        packageFragment = javaProject.findPackageFragment(packageFragmentPath);
      } catch (Exception e) {
        Activator.logException(e);
View Full Code Here

              // Determine whether on this classentry's path
              machings = entries[i].getPath()
                  .matchingFirstSegments(elementPath);
              if (machings > 0) {
                // Get package name
                classPath = elementPath.removeFirstSegments(
                    machings).removeLastSegments(1);
                break;
              }
            }
            // Not on the classpath?
View Full Code Here

      IVirtualFolder webContentFolder = getWebContentFolder(file.getProject());
      if (webContentFolder != null) {
        IPath webContentPath = webContentFolder.getProjectRelativePath();
        IPath filePath = file.getProjectRelativePath();
        int matchingFirstSegments = webContentPath.matchingFirstSegments(filePath);
        path = filePath.removeFirstSegments(matchingFirstSegments);
      }
    }
    return path;
  }
View Full Code Here

              ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
              String uri = null;
              if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
                IPath path = ((ITagDirRecord) taglibRecord).getPath();
                if (localContextRoot.isPrefixOf(path)) {
                  uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
                  uriToRecords.put(uri, taglibRecord);
                }
              }
            }
            /*
 
View Full Code Here

        final IWorkspaceContextResolver wkspaceResolver =
            IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver( getStructuredDocumentContext() );
        IResource resource = wkspaceResolver.getResource();
        IPath filePath = resource.getFullPath();
    if (filePath.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
      filePath = filePath.removeFirstSegments(webContentPath.segmentCount());
      filePath = filePath.removeLastSegments(1);
      filePath = filePath.append(value);
      IVirtualFile file = getWebRoot().getFile(filePath);
      if (!file.exists()){
        getValidationMessages().add(new ValidationMessage(Messages.WebPathType_2));
View Full Code Here

        IPath srcPath = new Path(newSourceLocation);
        if (workspaceRoot.findMember(srcPath) != null) {
          sourceLocation = newSourceLocation;
        } else if (wsRootPath.isPrefixOf(srcPath)) {
          int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
          srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
          sourceLocation = srcPath.toOSString();
        } else {
          sourceLocation = newSourceLocation;
          relativeToWorkspace = false;
        }
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.