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


Java PathUtil.getLocalPath方法代码示例

本文整理汇总了Java中com.intellij.util.PathUtil.getLocalPath方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.getLocalPath方法的具体用法?Java PathUtil.getLocalPath怎么用?Java PathUtil.getLocalPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.PathUtil的用法示例。


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

示例1: toRelativePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
/**
 * Get relative file
 *
 * @param file                          a valid file (must be either belong to {@link com.intellij.openapi.vfs.LocalFileSystem}  or to point to the root entry on
 *                                      {@link com.intellij.openapi.vfs.JarFileSystem}.
 * @param baseDir                       base director for relative path calculation
 * @param baseDirPropertyName           property name for the base directory
 * @param genOptions                    generation options
 * @return a relative path
 */
@Nullable
public static String toRelativePath(final VirtualFile file,
                                    final File baseDir,
                                    final String baseDirPropertyName,
                                    final GenerationOptions genOptions) {
    final String localPath = PathUtil.getLocalPath(file);
    if (localPath == null) {
        return null;
    }
    return toRelativePath(localPath, baseDir, baseDirPropertyName, genOptions);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GenerationUtils.java

示例2: sdkPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
static String sdkPath(@Nullable Sdk anyJdk) {
  if (anyJdk == null) {
    return null;
  }
  String jdkHomePath = PathUtil.getLocalPath(anyJdk.getHomeDirectory());
  if (jdkHomePath != null) {
    jdkHomePath = jdkHomePath.replace('/', File.separatorChar);
  }
  return jdkHomePath;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JdkPathMacro.java

示例3: expand

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
@Override
public String expand(DataContext dataContext) throws ExecutionCancelledException {
  Module module = LangDataKeys.MODULE.getData(dataContext);
  if (module == null) {
    Project project = CommonDataKeys.PROJECT.getData(dataContext);
    if (project == null) {
      return null;
    }
    Module[] modules = ModuleManager.getInstance(project).getModules();
    if (modules.length == 0) {
      return null;
    }
    module = modules[0];
  }
  Sdk sdk = PythonSdkType.findPythonSdk(module);
  if (sdk != null) {
    VirtualFile homeDir = sdk.getHomeDirectory();
    if (homeDir == null) {
      return null;
    }
    String path = PathUtil.getLocalPath(homeDir.getParent());
    if (path != null) {
      return FileUtil.toSystemDependentName(path);
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:InterpreterDirectoryMacro.java

示例4: toAbsolutePath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
private String toAbsolutePath(String genRelativePath) {
  if (genRelativePath == null) {
    return null;
  }
  if (genRelativePath.length() == 0) {
    return "";
  }
  String moduleDirPath = AndroidRootUtil.getModuleDirPath(myContext.getModule());
  if (moduleDirPath == null) return null;
  final String path = PathUtil.getCanonicalPath(new File(moduleDirPath, genRelativePath).getPath());
  return path != null ? PathUtil.getLocalPath(path) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AndroidFacetEditorTab.java

示例5: AntHectorConfigurable

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public AntHectorConfigurable(XmlFile file) {
  myFile = file;
  myProject = file.getProject();
  final VirtualFile selfVFile = myFile.getVirtualFile();
  myLocalPath = PathUtil.getLocalPath(selfVFile);
  myFileFilter = GlobalSearchScope.projectScope(myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AntHectorConfigurable.java

示例6: getGantLibraryHome

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public static String getGantLibraryHome(VirtualFile[] files) {
  for (VirtualFile file : files) {
    if (isGantJarFile(file.getName())) {
      final VirtualFile parent = LibrariesUtil.getLocalFile(file).getParent();
      if (parent != null) {
        final VirtualFile gantHome = parent.getParent();
        if (gantHome != null) {
          return PathUtil.getLocalPath(gantHome);
        }
      }
    }
  }
  return "";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GantUtils.java

示例7: getFSPath

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static String getFSPath(VirtualFile output) {
  return PathUtil.getLocalPath(output);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ConfigurationsTest.java

示例8: getDefaultWorkingDir

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Nullable
protected String getDefaultWorkingDir(@NotNull Project project) {
  return PathUtil.getLocalPath(project.getBaseDir());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ProgramParametersConfigurator.java

示例9: GroovyScriptRunConfiguration

import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public GroovyScriptRunConfiguration(final String name, final Project project, final ConfigurationFactory factory) {
  super(name, new RunConfigurationModule(project), factory);
  workDir = PathUtil.getLocalPath(project.getBaseDir());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GroovyScriptRunConfiguration.java


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