org.eclipse.core.resources.IPathVariableManager Java Examples

The following examples show how to use org.eclipse.core.resources.IPathVariableManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UndeployJob.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Undeploys the check configuration.
 *
 * @throws CoreException
 *           core exception.
 */
public static void undeployCheckConfiguration() throws CoreException {
  IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IPathVariableManager pathMan = workspace.getPathVariableManager();
  if (pathMan.getURIValue(CheckCfgConstants.CHECK_CFG_VAR_NAME) == null) {
    return;
  }
  pathMan.setURIValue(CheckCfgConstants.CHECK_CFG_VAR_NAME, null);
}
 
Example #2
Source File: GwtTestUtilities.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Sets up workspace variables to point at the the {@code GWT_ROOT} and {@code GWT_TOOLS}
 * environment variables, which point at a local clone of the GWT git repository. If those
 * environment variables are not set, extracts a snapshot of the GWT source tree that
 * is bundled with this plug-in and sets the environment variables to point at it.
 */
private static void setupWorkspaceVariables() throws CoreException {
  IPathVariableManager variableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();

  String gwtRoot = System.getenv("GWT_ROOT");
  if (gwtRoot == null) {
    System.out.println("The GWT_ROOT environment variable is not set, using test bundle version");
    gwtRoot = TestEnvironmentUtil.installTestSdk(
        GwtTestingPlugin.getDefault().getBundle(),
        Path.fromPortableString("/resources/gwt-root.zip")).append("trunk").toOSString();
    TestEnvironmentUtil.updateEnvironmentVariable("GWT_ROOT", gwtRoot);
    System.out.println("The GWT_ROOT environment variable is now set");
  }
  IPath gwtRootPath = Path.fromOSString(gwtRoot);
  if (variableManager.getURIValue("GWT_ROOT") == null) {
    CorePluginLog.logInfo("Setting GWT_ROOT = " + gwtRootPath.toOSString());
    variableManager.setURIValue("GWT_ROOT", gwtRootPath.toFile().toURI());
  }

  String gwtTools = System.getenv("GWT_TOOLS");
  if (gwtTools == null) {
    System.out.println("The GWT_TOOLS environment variable is not set, using GWT_ROOT as a base");
    gwtTools = gwtRoot + "/tools";
    TestEnvironmentUtil.updateEnvironmentVariable("GWT_TOOLS", gwtTools);
  }
  IPath gwtToolsPath = Path.fromOSString(gwtTools);
  if (JavaCore.getClasspathVariable("GWT_TOOLS") == null) {
    CorePluginLog.logInfo("Setting GWT_TOOLS = " + gwtToolsPath.toOSString());
    JavaCore.setClasspathVariable("GWT_TOOLS", gwtToolsPath, null);
  }
}
 
Example #3
Source File: GWTProjectsRuntime.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IStatus validate() {
  IWorkspace workspace = ResourcesPlugin.getWorkspace();
  IPathVariableManager pathVariableManager = workspace.getPathVariableManager();
  URI gwtUri = pathVariableManager.getURIValue("GWT_ROOT");
  if (gwtUri == null) {
    return new Status(IStatus.ERROR, GWTPlugin.PLUGIN_ID,
        "Path variable 'GWT_ROOT' is not defined");
  }

  IPath gwtRoot = URIUtil.toPath(gwtUri);
  if (gwtRoot == null) {
    return new Status(IStatus.ERROR, GWTPlugin.PLUGIN_ID,
        "Path variable 'GWT_ROOT' is not defined");
  }

  if (!gwtRoot.toFile().exists()) {
    return new Status(IStatus.ERROR, GWTPlugin.PLUGIN_ID,
        "Path variable 'GWT_ROOT' points to an invalid location");
  }

  if (findDevProject() == null) {
    return new Status(IStatus.ERROR, GWTPlugin.PLUGIN_ID, "Could not find and gwt-dev-* project");
  }

  if (findUserProject() == null) {
    return new Status(IStatus.ERROR, GWTPlugin.PLUGIN_ID, "Could not find the gwt-user project");
  }

  return getGwtDevJarStatus(this);
}
 
Example #4
Source File: ClientTester.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPathVariableManager getPathVariableManager() {
	// TODO Auto-generated method stub
	return null;
}
 
Example #5
Source File: FakeIFile.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPathVariableManager getPathVariableManager() {
	// TODO Auto-generated method stub
	return null;
}
 
Example #6
Source File: AbstractIResourceStub.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPathVariableManager getPathVariableManager() {
    return null;
}