Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IPathVariableManager


    return Collections.<IPath>unmodifiableCollection(result);
  }
 
  public IPath resolvePath(final IPath path) {
    IWorkspace _workspace = ResourcesPlugin.getWorkspace();
    final IPathVariableManager pathVariableManager = _workspace.getPathVariableManager();
    URI _uRI = URIUtil.toURI(path);
    URI _resolveURI = pathVariableManager.resolveURI(_uRI);
    return URIUtil.toPath(_resolveURI);
  }
View Full Code Here


  myLibrarySelector.setLayoutData(theGriddata);
  // Get the data in the tree
  myLibrarySelector.setRedraw(false);

  // IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IPathVariableManager pathMan = myProject.getPathVariableManager();

  URI ArduinoLibraryURI = pathMan.resolveURI(pathMan.getURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_ARDUINO_LIB));
  URI PrivateLibraryURI = pathMan.resolveURI(pathMan.getURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_PRIVATE_LIB));
  URI HardwareLibrarURI = pathMan.resolveURI(pathMan.getURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_HARDWARE_LIB));

  if (HardwareLibrarURI != null) {
      IPath HardwareLibraryPath = URIUtil.toPath(HardwareLibrarURI);

      if ((HardwareLibraryPath.toFile().exists()) && (HardwareLibraryPath.toFile().list().length > 0)) {
View Full Code Here

     *
     */
    private void setWorkSpacePathVariables() {

  IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IPathVariableManager pathMan = workspace.getPathVariableManager();

  try {
      IPath ArduinoIDEPath = Common.getArduinoIDEPathFromUserSelection(mArduinoIdePath.getStringValue());
      pathMan.setURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_ARDUINO_LIB,
        URIUtil.toURI(ArduinoIDEPath.append(ArduinoConst.LIBRARY_PATH_SUFFIX).toString()));
      pathMan.setURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_PRIVATE_LIB, URIUtil.toURI(mArduinoPrivateLibPath.getStringValue()));
      pathMan.setURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_ARDUINO, URIUtil.toURI(ArduinoIDEPath));
  } catch (CoreException e) {
      Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID,
        "Failed to create the workspace path variables. The setup will not work properly", e));
      e.printStackTrace();
  }
View Full Code Here

  LinkFolderToFolder(project, new Path(PathVarName).append(SubFolder), new Path(LinkName));

  // Now the folder has been created we need to make sure the special folders are added to the path
  addIncludeFolder(configurationDescription, link.getFullPath());

  IPathVariableManager pathMan = project.getPathVariableManager();

  String possibleIncludeFolder = "utility";
  File file = new File(new Path(pathMan.resolveURI(pathMan.getURIValue(PathVarName)).getPath()).append(SubFolder).append(possibleIncludeFolder)
    .toString());
  if (file.exists()) {
      addIncludeFolder(configurationDescription, link.getFullPath().append(possibleIncludeFolder));
  }

  possibleIncludeFolder = "src";
  file = new File(new Path(pathMan.resolveURI(pathMan.getURIValue(PathVarName)).getPath()).append(SubFolder).append(possibleIncludeFolder)
    .toString());
  if (file.exists()) {
      addIncludeFolder(configurationDescription, link.getFullPath().append(possibleIncludeFolder));
  }

  possibleIncludeFolder = "arch";
  file = new File(new Path(pathMan.resolveURI(pathMan.getURIValue(PathVarName)).getPath()).append(SubFolder).append(possibleIncludeFolder)
    .toString());
  if (file.exists()) {
      addIncludeFolder(configurationDescription,
        link.getFullPath().append(possibleIncludeFolder).append(makeEnvironmentVar(ENV_KEY_ARCHITECTURE)));
  }
View Full Code Here

  String NiceName = Path.lastSegment();
  String PathName = project.getName() + NiceName;
  URI ShortPath = URIUtil.toURI(Path.removeTrailingSeparator().removeLastSegments(1));

  IWorkspace workspace = project.getWorkspace();
  IPathVariableManager pathMan = workspace.getPathVariableManager();

  pathMan.setURIValue(PathName, ShortPath);

  addCodeFolder(project, PathName, NiceName, NiceName, configurationDescription);

    }
View Full Code Here

     * @param project
     */
    public static void setProjectPathVariables(IProject project, IPath platformPath) {
  IPath PinPath = platformPath.append(ArduinoConst.VARIANTS_FOLDER);
  IPath arduinoHardwareLibraryPath = platformPath.append(ArduinoConst.LIBRARY_PATH_SUFFIX);
  IPathVariableManager pathMan = project.getPathVariableManager();
  try {
      // TODO the code below was changed for issue #34 (better multiple user support) but fails on Mac
      // So i split it to use the old code on mac.
      // but they should be merged
      // then it turned out nothing worked anymore. So I reverted to the old code
      // Path arduinoPath = new Path(pathMan.getURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_ARDUINO).getRawPath());
      // if (Platform.getOS().equals(Platform.OS_MACOSX)) {
      pathMan.setURIValue(ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_HARDWARE_LIB, URIUtil.toURI(arduinoHardwareLibraryPath));
      pathMan.setURIValue(ArduinoConst.PATH_VARIABLE_NAME_ARDUINO_PLATFORM, URIUtil.toURI(platformPath));
      pathMan.setURIValue(ArduinoConst.PATH_VARIABLE_NAME_ARDUINO_PINS, URIUtil.toURI(PinPath));
      // } else {
      //
      // String prefix = "${" + ArduinoConst.WORKSPACE_PATH_VARIABLE_NAME_ARDUINO + "}/";
      // String test = prefix + arduinoHardwareLibraryPath.makeRelativeTo(arduinoPath).toString();
      // // URI uriTest = URIUtil.toURI(test, false);
View Full Code Here

  }

  var = new EnvironmentVariable(ENV_KEY_archive_file, "arduino.ar");
  contribEnv.addVariable(var, confDesc);

  IPathVariableManager pathMan = confDesc.getProjectDescription().getProject().getPathVariableManager();
  URI buildVariantURI = pathMan.getURIValue(ArduinoConst.PATH_VARIABLE_NAME_ARDUINO_PINS);
  buildVariantURI = pathMan.resolveURI(buildVariantURI);
  String buildVariantPath = buildVariantURI.getPath() + "/${" + ArduinoConst.ENV_KEY_build_variant + "}";
  var = new EnvironmentVariable(ENV_KEY_build_variant_path, buildVariantPath);
  contribEnv.addVariable(var, confDesc);
  // IPath platformPath = new Path(arduinoProperties.getPlatformFolder());
  // IPath PinPath = platformPath.append(ArduinoConst.VARIANTS_FOLDER);
View Full Code Here

          if (file.exists()) {
            return file.toURI();
          }
        }
        else {
          IPathVariableManager variableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();
          return variableManager.resolveURI(uri);
        }
      }
    }
    return null;
  }
View Full Code Here

          if (sourceControlFile.exists()) {
            addUri(paths, sourceControlFile.toURI());
          }
        }
        else {
          IPathVariableManager variableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();
          addUri(paths, variableManager.resolveURI(uri));
        }
      }
    }
  }
View Full Code Here

          String scheme = uri.getScheme();
          if (SpringCoreUtils.FILE_SCHEME.equalsIgnoreCase(scheme)) {
            return toLocalFile(uri);
          }
          else {
            IPathVariableManager variableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();
            return toLocalFile(variableManager.resolveURI(uri));
          }
        }
      }
    }
    return null;
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IPathVariableManager

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.