Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath


      WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
      IFolder mediumFolder = helper.getTmlRoot().getFolder(medium);

      // cut off path up to medium
      int segments = referer.getLocation().matchingFirstSegments(mediumFolder.getLocation());
      IPath relativePathToMediumFolder = referer.getLocation().removeFirstSegments(segments).removeLastSegments(1);

      String referencePath = null;
      reference = reference.toLowerCase();
      if (reference.startsWith("::")) {
        String tmpPath = scriptType + "/";
        for (int i = 0; i < relativePathToMediumFolder.segmentCount(); i++) {
          tmpPath += relativePathToMediumFolder.segment(i) + "/";
        }

        referencePath = reference.replace("::", tmpPath);
        referencePath = referencePath.replaceAll(":", "/");
        referencePath += "." + scriptType;
      } else {
          VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(referer);       
          if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
              IPath path = referer.getFullPath();
                    if (path.toString().contains("/overlay/")) {
                        if (reference.endsWith("@base")) {                                                
                        reference = reference.substring(0, reference.lastIndexOf("@"));                   
                    } else {
                        // this is a base reference in an overlay provider - remove @base marker and add overlay root               
                            reference = "overlay:" + reference;
View Full Code Here


    WGADesignStructureHelper helper = new WGADesignStructureHelper(tmlFile);
    String medium = determineMediaKey(tmlFile);
    if (medium == null) {
      medium = "html";
    }
    IPath tmlFilePath = FileUtils.makeRelative(helper.getTmlRoot().getLocation().append(medium), tmlFile.getLocation());
    String tmlReference = tmlFilePath.removeFileExtension().toString().replaceAll("/", ":");
    URL url = new URL(root.toString() + "/" + dbkey + "/" + medium + "/" + tmlReference);
    return url;
  }
View Full Code Here

 
  public String computeTMLReference(IFile tmlFile) {
      String mediaKey = determineMediaKey(tmlFile);     
      IContainer base = getTmlRoot().getFolder(mediaKey);
     
      IPath basePath = base.getFullPath();
      IPath path = tmlFile.getFullPath();     
      if(basePath.isPrefixOf(path)){
          path = path.removeFirstSegments(basePath.segmentCount());            
          path = path.removeFileExtension();
            return path.toString().replace('/', ':');
        }
      return null;
  }
View Full Code Here

    } else {
      medium = mymedium;
    }

    // the path of the selected medium
    IPath mediumPath = designHelper.getTmlRoot().getFolder(new Path(medium)).getProjectRelativePath();

    // the path to the file which we are currently editing
    IPath pathOfEditedFile = activeFile.getParent().getProjectRelativePath();
    pathOfEditedFile = pathOfEditedFile.removeFirstSegments(mediumPath.segmentCount());

    ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
    if (rsm != null) {
      nontmlspecificrefs = rsm.getTMLpaths(activeFile, medium);

      Iterator<String> it = nontmlspecificrefs.iterator();
      while (it.hasNext()) {

        // current file from the db
        IPath currentFile = new Path(it.next()).removeFileExtension();

        // path of the current file
        IPath currentFilePath = currentFile.removeLastSegments(1);

        // removing the path of the elected medium
        currentFilePath = currentFilePath.removeFirstSegments(mediumPath.segmentCount());

        // removing the path of the elected medium
        currentFile = currentFile.removeFirstSegments(mediumPath.segmentCount());

        IPath tmp = null;
       
        String reference = currentFile.toString().replaceAll("\\/", ":");
       
       
        if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
            if (reference.startsWith("overlay:") && pathOfEditedFile.toString().contains("overlay")) {
                reference = reference.substring("overlay:".length());
            } else if (pathOfEditedFile.toString().contains("overlay")) {
                reference = reference + "@base";
            }
        }
        tmlfilerefs.add(reference);

        if (pathOfEditedFile.segmentCount() > 0 && (currentFilePath.segmentCount() >= pathOfEditedFile.segmentCount()) && medium.equals(mymedium)) {
          int a = currentFilePath.segmentCount();
          int b = pathOfEditedFile.segmentCount();
          tmp = currentFilePath.removeLastSegments(a - b);
          if (tmp.equals(pathOfEditedFile)) {
            currentFilePath = currentFile.removeFirstSegments(tmp.segmentCount());
            tmlfilerefs.add("::" + currentFilePath.toString().replaceAll("\\/", ":"));
          }

        }
View Full Code Here

        }
       
        // retrieve J2EE libs
        Bundle bundle = Platform.getBundle("de.innovationgate.eclipse.plugins.Core");
        if (bundle != null && wgaVersion != null) {           
            IPath path = new Path("resources").append("librarySets");
            if (wgaVersion.isAtLeast(5, 0)) {
                path = path.append("j2ee14");
            } else {
                path = path.append("j2ee13");
            }
            URL librarySetURL = FileLocator.find(bundle, path, null);                       
            try {
                File librarySetsDir = new File(FileLocator.toFileURL(librarySetURL).getPath());
                File[] jars = librarySetsDir.listFiles(new FilenameFilter() {
View Full Code Here

    }

    public void resourceChanged(IResourceChangeEvent event) {

        final IPath dsgPath = _model.getDesignContainer().getFullPath();
        try {
            myDeltaVisitor visitor = new myDeltaVisitor();
            event.getDelta().accept(visitor);
            if (visitor.isRefreshNeeded()) {
                refresh();
View Full Code Here

    dialog.setTitle("Please select an initialisation script");
   
    int result = dialog.open();
    if (result == ListDialog.OK) {
      IFile selectedScript = (IFile) dialog.getResult()[0];
      IPath selectedScriptPath = selectedScript.getLocation();
      IPath tmlScriptDirectoryPath = new Path(_model.getTMLScriptDirectory().getAbsolutePath());     
      _txtInitScript.setText(computePathToScriptFrom(tmlScriptDirectoryPath,selectedScriptPath));
         
    }   
  }
View Full Code Here

    dialog.setTitle("Please select an connection script");
   
    int result = dialog.open();
    if (result == ListDialog.OK) {
        IFile selectedScript = (IFile) dialog.getResult()[0];
          IPath selectedScriptPath = selectedScript.getLocation();
          IPath tmlScriptDirectoryPath = new Path(_model.getTMLScriptDirectory().getAbsolutePath());         
          _txtConnectionScript.setText(computePathToScriptFrom(tmlScriptDirectoryPath,selectedScriptPath));
   
  }
View Full Code Here

    dialog.setTitle("Please select a disconnection script");
   
    int result = dialog.open();
    if (result == ListDialog.OK) {
        IFile selectedScript = (IFile) dialog.getResult()[0];
          IPath selectedScriptPath = selectedScript.getLocation();
          IPath tmlScriptDirectoryPath = new Path(_model.getTMLScriptDirectory().getAbsolutePath());         
          _txtDisconnectionScript.setText(computePathToScriptFrom(tmlScriptDirectoryPath,selectedScriptPath));
   
  }
View Full Code Here

    _tmlMetadataFileListener = new TMLMetadataFileMaintainer();
    ResourcesPlugin.getWorkspace().addResourceChangeListener(_tmlMetadataFileListener, IResourceChangeEvent.POST_CHANGE|IResourceChangeEvent.PRE_BUILD);   
    _projectBuilderManager = new ProjectBuilderManager();
    ResourcesPlugin.getWorkspace().addResourceChangeListener(_projectBuilderManager, IResourceChangeEvent.POST_CHANGE|IResourceChangeEvent.PRE_BUILD);
    _projectBuilderManager.performPluginStartup();     
    IPath stateLocation = getStateLocation();   

        _headerFileMap.put(HEADER_TML_MODUL, new HeaderHandler(HEADER_TML_MODUL, stateLocation.append("defaultTmlModulLicense.txt").toFile(), "TML-Modules"));
        _headerFileMap.put(HEADER_CSS_MODUL, new HeaderHandler(HEADER_CSS_MODUL, stateLocation.append("defaultCssModulLicense.txt").toFile(), "CSS-Modules"));
        _headerFileMap.put(HEADER_JS_MODUL, new HeaderHandler(HEADER_JS_MODUL, stateLocation.append("defaultJsModulLicense.txt").toFile(), "JS-Modules"));
        _headerFileMap.put(HEADER_TMLSCRIPT_MODUL, new HeaderHandler(HEADER_TMLSCRIPT_MODUL, stateLocation.append("defaultTmlScriptModulLicense.txt").toFile(), "TMLScripts-Modules"));
        _headerFileMap.put(HEADER_VBS_MODUL, new HeaderHandler(HEADER_VBS_MODUL, stateLocation.append("defaultVbsModulLicense.txt").toFile(), "VBS-Modules"));
        _headerFileMap.put(HEADER_XML_MODUL, new HeaderHandler(HEADER_XML_MODUL, stateLocation.append("defaultXmlModulLicense.txt").toFile(), "XML-Modules"));     

  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IPath

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.