本文整理匯總了Java中com.intellij.openapi.application.PathManager.getResourceRoot方法的典型用法代碼示例。如果您正苦於以下問題:Java PathManager.getResourceRoot方法的具體用法?Java PathManager.getResourceRoot怎麽用?Java PathManager.getResourceRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.application.PathManager
的用法示例。
在下文中一共展示了PathManager.getResourceRoot方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAntClassPath
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private void createAntClassPath(final File platformDir) {
classPaths = new ArrayList<>();
//brutal hack. Do not do this at home, kids!
//we are hiding class in a classpath to confuse the classloader and pick our implementation
final String entry = PathManager.getResourceRoot(
HybrisIdeaAntLogger.class, "/" + HybrisIdeaAntLogger.class.getName().replace('.', '/') + ".class"
);
classPaths.add(new SinglePathEntry(entry));
//end of hack
final File platformLibDir = new File(platformDir, HybrisConstants.LIB_DIRECTORY);
classPaths.add(new AllJarsUnderDirEntry(platformLibDir));
classPaths.addAll(
extHybrisModuleDescriptorList
.parallelStream()
.map(e -> new AllJarsUnderDirEntry(new File(e.getRootDirectory(), HybrisConstants.LIB_DIRECTORY)))
.collect(Collectors.toList())
);
final File libDir = new File(platformDir, HybrisConstants.ANT_LIB_DIR);
classPaths.add(new AllJarsUnderDirEntry(libDir));
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:21,代碼來源:DefaultAntConfigurator.java
示例2: addBundle
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
/**
* Configures given classpath to reference target i18n bundle file(s).
*
* @param classPath process classpath
* @param bundlePath path to the target bundle file
* @param contextClass class from the same content root as the target bundle file
*/
public static void addBundle(@NotNull PathsList classPath, @NotNull String bundlePath, @NotNull Class<?> contextClass) {
String pathToUse = bundlePath.replace('.', '/');
if (!pathToUse.endsWith(".properties")) {
pathToUse += ".properties";
}
if (!pathToUse.startsWith("/")) {
pathToUse = '/' + pathToUse;
}
String root = PathManager.getResourceRoot(contextClass, pathToUse);
if (root != null) {
classPath.add(root);
}
}
示例3: addIdeaLibraries
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static void addIdeaLibraries(@NotNull Collection<URL> classpath) throws MalformedURLException {
Class<BootstrapClassLoaderUtil> aClass = BootstrapClassLoaderUtil.class;
String selfRoot = PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
assertNotNull(selfRoot);
URL selfRootUrl = new File(selfRoot).getAbsoluteFile().toURI().toURL();
classpath.add(selfRootUrl);
File libFolder = new File(PathManager.getLibPath());
addLibraries(classpath, libFolder, selfRootUrl);
addLibraries(classpath, new File(libFolder, "ext"), selfRootUrl);
addLibraries(classpath, new File(libFolder, "ant/lib"), selfRootUrl);
}
示例4: setUp
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
super.setUp();
//PlatformTestCase.initPlatformLangPrefix();
File pluginRoot = new File(PluginPathManager.getPluginHomePath("svn4idea"));
if (!pluginRoot.isDirectory()) {
// try standalone mode
Class aClass = Svn17TestCase.class;
String rootPath = PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
pluginRoot = new File(rootPath).getParentFile().getParentFile().getParentFile();
}
myWorkingCopyRoot = new File(pluginRoot, "testData/move2unv");
myLocks = new SvnTestWriteOperationLocks(new WorkingCopy(myWorkingCopyRoot, SVNURL.parseURIEncoded("http://a.b.c"), true));
}
示例5: setUp
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
super.setUp();
//PlatformTestCase.initPlatformLangPrefix();
File pluginRoot = new File(PluginPathManager.getPluginHomePath("svn4idea"));
if (!pluginRoot.isDirectory()) {
// try standalone mode
Class aClass = Svn17TestCase.class;
String rootPath = PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
pluginRoot = new File(rootPath).getParentFile().getParentFile().getParentFile();
}
myWorkingCopyRoot = new File(pluginRoot, "testData/move2unv");
}
示例6: getResourcePath
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public static String getResourcePath(Class aClass) {
return PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
}
示例7: getResourcePath
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static File getResourcePath(Class aClass) {
return new File(PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class"));
}
示例8: getJarForResource
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
/**
* Get path for resources.jar
*
* @param context a context class
* @param res a resource
* @return a path to classpath entry
*/
@SuppressWarnings({"SameParameterValue"})
public static String getJarForResource(Class context, String res) {
String resourceRoot = PathManager.getResourceRoot(context, res);
return new File(resourceRoot).getAbsoluteFile().getAbsolutePath();
}