当前位置: 首页>>代码示例>>Java>>正文


Java IPathVariableManager类代码示例

本文整理汇总了Java中org.eclipse.core.resources.IPathVariableManager的典型用法代码示例。如果您正苦于以下问题:Java IPathVariableManager类的具体用法?Java IPathVariableManager怎么用?Java IPathVariableManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IPathVariableManager类属于org.eclipse.core.resources包,在下文中一共展示了IPathVariableManager类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: covertPathToUrl

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
private static void covertPathToUrl(IProject project, Set<URL> paths, IPath path) {
	if (path != null && project != null && path.removeFirstSegments(1) != null && project.findMember(path.removeFirstSegments(1)) != null) {

		URI uri = project.findMember(path.removeFirstSegments(1)).getRawLocationURI();

		if (uri != null) {
			String scheme = uri.getScheme();
			if (FILE_SCHEME.equalsIgnoreCase(scheme))
				addUri(paths, uri);
			else if ("sourcecontrol".equals(scheme)) {
				// special case of Rational Team Concert
				IPath sourceControlPath = project.findMember(path.removeFirstSegments(1)).getLocation();
				File sourceControlFile = sourceControlPath.toFile();
				if (sourceControlFile.exists())
					addUri(paths, sourceControlFile.toURI());
			} else {
				IPathVariableManager variableManager = ResourcesPlugin.getWorkspace().getPathVariableManager();
				addUri(paths, variableManager.resolveURI(uri));
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:JavaProjectClassLoader.java

示例2: undeployCheckConfiguration

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:15,代码来源:UndeployJob.java

示例3: createRelativePath

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * Transform an absolute path URI to a relative path one (i.e. from "C:\foo\bar\file.txt" to
 * "VAR\file.txt" granted that the relativeVariable is "VAR" and points to "C:\foo\bar\").
 *
 * @param location
 * @param resource
 * @return an URI that was made relative to a variable
 */
private IPath createRelativePath(IPath location, IResource resource) {
  if (relativeVariable == null) return location;
  if (relativeVariable.equals(ABSOLUTE_PATH)) return location;
  IPathVariableManager pathVariableManager = resource.getPathVariableManager();
  try {
    return URIUtil.toPath(
        pathVariableManager.convertToRelative(URIUtil.toURI(location), true, relativeVariable));
  } catch (CoreException e) {
    return location;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:ImportOperation.java

示例4: setupWorkspaceVariables

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * 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);
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:37,代码来源:GwtTestUtilities.java

示例5: validate

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
@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);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:32,代码来源:GWTProjectsRuntime.java

示例6: getSourceFile

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * @param source
 * @return File object, corresponding to given resource. This file could be
 * deleted or not yet created.
 */
protected File getSourceFile(IResource source) {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    // linked resources will be resolved here!
    IPath rawPath = source.getRawLocation();

    // here we should resolve path variables,
    // probably existing at first place of path
    IPathVariableManager pathManager = workspace.getPathVariableManager();
    rawPath = pathManager.resolvePath(rawPath);
    return rawPath.toFile();
}
 
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:17,代码来源:SyncWizard.java

示例7: validateLinkLocation

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * Validates this page's controls.
    * @param folderName the folder name
 *
 * @return IStatus indicating the validation result. IStatus.OK if the
 *  specified link target is valid given the linkHandle.
 */
private IStatus validateLinkLocation(String folderName) {
	IWorkspace workspace= JavaPlugin.getWorkspace();
	IPath path= Path.fromOSString(fLinkFields.fLinkLocation.getText());

	Path folderLocation= new Path(folderName);
	if (folderLocation.isAbsolute())
		return new StatusInfo(IStatus.ERROR, NewWizardMessages.AddSourceFolderWizardPage_error_NotARelativePathName);

	IProject project= fNewElement.getJavaProject().getProject();
	IFolder folder= project.getFolder(folderLocation);
	IStatus locationStatus= workspace.validateLinkLocation(folder, path);
	if (locationStatus.matches(IStatus.ERROR))
		return locationStatus;

	IPathVariableManager pathVariableManager= project.getPathVariableManager();
	IPath path1= Path.fromOSString(fLinkFields.fLinkLocation.getText());
	IPath resolvedPath= pathVariableManager.resolvePath(path1);
	// use the resolved link target name
	String resolvedLinkTarget= resolvedPath.toOSString();

	path= new Path(resolvedLinkTarget);
	File linkTargetFile= new Path(resolvedLinkTarget).toFile();
	if (linkTargetFile.exists()) {
		if (!linkTargetFile.isDirectory())
            return new StatusInfo(IStatus.ERROR, NewWizardMessages.NewFolderDialog_linkTargetNotFolder);
	} else {
		return new StatusInfo(IStatus.ERROR, NewWizardMessages.NewFolderDialog_linkTargetNonExistent);
	}
	if (locationStatus.isOK()) {
		return new StatusInfo();
	}
	return new StatusInfo(locationStatus.getSeverity(), locationStatus.getMessage());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:AddSourceFolderWizardPage.java

示例8: createRelativePath

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
     * Transform an absolute path URI to a relative path one (i.e. from
     * "C:\foo\bar\file.txt" to "VAR\file.txt" granted that the relativeVariable
     * is "VAR" and points to "C:\foo\bar\").
     * 
     * @param location
     * @param resource 
     * @return an URI that was made relative to a variable
     */
    private IPath createRelativePath(IPath location, IResource resource) {
		if (relativeVariable == null)
			return location;
		if (relativeVariable.equals(ABSOLUTE_PATH))
			return location;
		IPathVariableManager pathVariableManager = resource.getPathVariableManager();
//		try {
//			return URIUtil.toPath(pathVariableManager.convertToRelative(URIUtil.toURI(location), true, relativeVariable));
//		} catch (CoreException e) {
//			return location;
//		}
		return null;  // temporary
	}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:23,代码来源:OwlImportOperation.java

示例9: getPathVariableManager

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
@Override
public IPathVariableManager getPathVariableManager() {
	// not required
	return null;
}
 
开发者ID:1Tristan,项目名称:VariantSync,代码行数:6,代码来源:ProjectRoot.java

示例10: getPathVariableManager

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
@Override
public IPathVariableManager getPathVariableManager() {
  throw new UnsupportedOperationException();
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:Workspace.java

示例11: getPathVariableManager

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
public IPathVariableManager getPathVariableManager() {
  //        if (getProject() == null)
  //            return workspace.getPathVariableManager();
  //        return new ProjectPathVariableManager(this);
  throw new UnsupportedOperationException();
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:Resource.java

示例12: getPathVariableManager

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IPathVariableManager getPathVariableManager() {
  return resource().getPathVariableManager();
}
 
开发者ID:sealuzh,项目名称:PerformanceHat,代码行数:8,代码来源:AbstractBaseResourceDecorator.java

示例13: getPathVariableManager

import org.eclipse.core.resources.IPathVariableManager; //导入依赖的package包/类
@Override
public IPathVariableManager getPathVariableManager() {
    return null;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:5,代码来源:AbstractIResourceStub.java


注:本文中的org.eclipse.core.resources.IPathVariableManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。