Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath


  @Override
  public void createPartControl(Composite parent) {
    _browser = new Browser(parent, SWT.NONE);
    Bundle plugin = WGADesignerPlugin.getDefault().getBundle();
    IPath relativePagePath = new Path("resources/html/gettingStarted/step1.1.html");
    URL fileInPlugin = FileLocator.find(plugin, relativePagePath, null);
    if (fileInPlugin != null) {
      try {
        URL pageUrl = FileLocator.toFileURL(fileInPlugin);
        _browser.setUrl(pageUrl.toString());
View Full Code Here


            }
        }
    }

    private File getWorkingSetMemento() {
        IPath path = WGADesignerPlugin.getDefault().getStateLocation();
        if (path == null) {
            return null;
        }
        path = path.append("runtimeViewSelectedWorkingsets.xml");
        return path.toFile();
    }
View Full Code Here

        monitor.setTaskName("retrieving remote resouce states");
        List<FSDesignResourceState> remoteStates = _server.getServices().retrieveFSDesignResourceState(_server.getSession(), computeRelativPathFromDesignRoot(start).toString());
       
        // map states by path rooted to wga designroot
        for (LocalFSDesignResourceState state : localStates) {
          IPath path = new Path(state.getPath());
          _localStates.put(path.makeRelative(), state);
        }       
        for (FSDesignResourceState state : remoteStates) {
          IPath path = new Path(state.getPath());
          _remoteStates.put(path.makeRelative(), state);   
        }
       
        // perform steps for plugin sync if runtime is started
        if (TomcatUtils.getInstance().isRunning(_runtime)) {
            monitor.beginTask("connecting to local WGA server", IProgressMonitor.UNKNOWN);
View Full Code Here

    return resource.getFullPath().removeFirstSegments(matchingSegments).makeRelative();
  }
   
  private IResource convertToResource(FSDesignResourceState state) {
    // compute full qualified path to resource
    IPath path = null;
    if (state instanceof LocalFSDesignResourceState) {
      // local resource use full qualified path
      path = ((LocalFSDesignResourceState)state).getFqPath();
    } else {
      // remote state
View Full Code Here

      BeanMapPreferencesStore<IPath, LibraryClasspathEntryInformation> store = WGADesignerPlugin.getDefault().getLibraryClasspathEntryInformationStore();
      store.load();
      Map<IPath, LibraryClasspathEntryInformation> infos = store.getBeans();
      for( File lib: libs ) {
        IClasspathEntry entry = JavaCore.newLibraryEntry(new Path(lib.getAbsolutePath()), null, null);
        IPath srcPath = jarToProjectSource.get(lib.getName());
        if (srcPath != null) {
          if (!infos.containsKey(new Path(lib.getAbsolutePath()))) {
            LibraryClasspathEntryInformation info = new LibraryClasspathEntryInformation();
            info.setSourcePath(srcPath);
            store.getBeans().put(entry.getPath(), info);
View Full Code Here

    IClasspathEntry[] entries =  _librarySet.getClasspathEntries();
    for (IClasspathEntry entry : entries) {
      // check if we have additional infos for this entry
      LibraryClasspathEntryInformation info = infos.get(entry.getPath());
      if (info != null) {
        IPath srcPath = info.getSourcePath();
        IPath srcRoot = new Path("/");
        if (srcPath == null) {
          srcPath = new Path("");
          srcRoot = null;
        }
       
View Full Code Here

                        monitor.setTaskName("transfering design");
                        IContainer designContainer = _runtime.getConnectedDesignContainers().get(_webApplication);
                        designContainer.accept(new IResourceVisitor() {

                            public boolean visit(IResource resource) throws CoreException {
                                IPath remotePathObj = resource.getLocation();
                                int count = remotePathObj.matchingFirstSegments(_runtime.getDesignRoot().getLocation());
                                remotePathObj = remotePathObj.removeFirstSegments(count);
                                String remotePath = remotePathObj.toString();
                                if (resource.getType() == IResource.FILE) {
                                    DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
                                    try {
                                        _remoteServer.getServices().updateFSDesignResource(_remoteServer.getSession(), remotePath, content, resource.getLocalTimeStamp());
                                    }
View Full Code Here

        }
      }
    }
 
  public static final IPath makeRelative(IPath source, IPath context){
    IPath result = new Path("");
    int mfs = source.matchingFirstSegments(context);
    source = source.removeFirstSegments(mfs);
    context = context.removeFirstSegments(mfs);
   
    for(int i=0;i < source.segmentCount();i++){
      result=result.append("../");
    }
    result=result.append(context);   
   
    return result;
  }
View Full Code Here

            IFolder mediumFolder = helper.getTmlRoot().getFolder(WGADesignStructureHelper.determineMediaKey(referer));
           
            // 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 = "/";
                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)) {
                    if (reference.endsWith("@base")) {                            
                        IPath path = referer.getFullPath();
                        if (path.toString().contains("/overlay/")) {
                            // this is a base reference in an overlay provider - remove @base marker and add overlay root
                            reference = reference.substring(0, reference.lastIndexOf("@"));               
                            reference = "overlay:" + reference;   
                        }
                    }
View Full Code Here

    IFolder tmlFolder = getTmlRoot();
   
    if (referer != null) {
        VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(referer);   
        if (versionCompliance != null && versionCompliance.toWGAVersion() != null && versionCompliance.toWGAVersion().isAtLeast(5, 4)) {
            IPath path = referer.getFullPath().makeRelativeTo(getTmlRoot().getFullPath().append(WGADesignStructureHelper.determineMediaKey(referer)));
                if (path.toString().startsWith("overlay/") && !reference.startsWith("::")) {
                    if (reference.toLowerCase().endsWith("@base")) {
                        reference = reference.substring(0, reference.lastIndexOf("@"));       
                    } else  {
                        // this is a reference within an overlay - remove @base marker and add overlay folder to complete the path
                        reference = reference.substring(0, reference.lastIndexOf("@"));               
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.