Package org.eclipse.core.runtime

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


    // the FILTERTYPE expression!
    String tempRulesFileName = getTempRulesFileName();
    IPath path = new Path(tempRulesFileName);
    ae.setConfigParameterValue(RutaEngine.PARAM_MAIN_SCRIPT, path.removeFileExtension()
            .lastSegment());
    String portableString = path.removeLastSegments(1).toPortableString();
    ae.setConfigParameterValue(RutaEngine.PARAM_SCRIPT_PATHS, new String[] { portableString });
    ae.setConfigParameterValue(RutaEngine.PARAM_ADDITIONAL_SCRIPTS, new String[0]);
    ae.setConfigParameterValue(RutaEngine.PARAM_RELOAD_SCRIPT, true);
    if (useDynamicAnchoring) {
      ae.setConfigParameterValue(RutaEngine.PARAM_DYNAMIC_ANCHORING, true);
View Full Code Here


  public static synchronized String getEngineDescriptorFromTMSourceFile(IPath scriptFilePath) {
    IPath folder = scriptFilePath;

    while (!folder.lastSegment().equals(RutaProjectUtils.getDefaultScriptLocation())) {
      folder = folder.removeLastSegments(1);
    }
    IPath relativeTo = scriptFilePath.makeRelativeTo(folder);
    IPath projectPath = folder.removeLastSegments(1);
    String elementName = scriptFilePath.lastSegment();
    int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
View Full Code Here

  public static synchronized String getTypeSystemDescriptorFromTMSourceFile(IPath scriptFilePath) {
    IPath folder = scriptFilePath;

    while (!folder.lastSegment().equals(RutaProjectUtils.getDefaultScriptLocation())) {
      folder = folder.removeLastSegments(1);
    }
    IPath relativeTo = scriptFilePath.makeRelativeTo(folder);
    IPath projectPath = folder.removeLastSegments(1);
    String elementName = scriptFilePath.lastSegment();
    int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
View Full Code Here

    // resolve to absolute url : this need not exact location of css file. It is important that absurl is not null.
    String ref = getElement().getAttribute(HTML40Namespace.ATTR_NAME_HREF);
    String absurl = (resolver != null && ref != null && ref.length() > 0) ? resolver.getLocationByURI(ref, true) : null;
    if ((absurl == null) || (absurl.length() == 0)) {
      IPath basePath = new Path(baseModel.getBaseLocation());
      URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
      absurl = helper.toAbsolute(ref == null ? "" : ref);//$NON-NLS-1$
    }
    if ((absurl == null) || (absurl.length() == 0)) {
      absurl = ref;
    }
View Full Code Here

          if (reference.startsWith(SLASH)) {
            referenceRuntimePath = new Path(reference);
          }
          else {
            IPath baseRuntimePath = virtualResources[i].getRuntimePath();
            referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
          }
         
          IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
          if (virtualFile != null && virtualFile.exists()) {
            IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
View Full Code Here

      return rootPath;
    }
    // try to handle out-of-workspace paths
    IPath root = path.makeAbsolute();
    while (root.segmentCount() > 0 && !root.isRoot())
      root = root.removeLastSegments(1);
    return root;
  }

  private void internalRemoveTaglibIndexListener(ITaglibIndexListener listener) {
    try {
View Full Code Here

        String ext = extPath.getFileExtension();
        if (ext == null){
          String lastSeg = extPath.lastSegment();
          if (lastSeg.equals("*")) //$NON-NLS-1$
          {
            return extPath.removeLastSegments(1).toString();
          }
         
          return extPath.toString();       
        }
      }
View Full Code Here

            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

                if (ext == null)
                {
                    String lastSeg = extPath.lastSegment();
                    if (lastSeg != null && lastSeg.equals("*")) //$NON-NLS-1$
                    {
                        return extPath.removeLastSegments(1).toString();
                    }

                    return extPath.toString();
                }
            }
View Full Code Here

        String ext = extPath.getFileExtension();
        if (ext == null){
          String lastSeg = extPath.lastSegment();
          if (lastSeg.equals("*")) //$NON-NLS-1$
          {
            return extPath.removeLastSegments(1).toString();
          }
         
          return extPath.toString();       
        }
      }
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.