本文整理匯總了Java中com.intellij.openapi.application.PathManager.getPluginsPath方法的典型用法代碼示例。如果您正苦於以下問題:Java PathManager.getPluginsPath方法的具體用法?Java PathManager.getPluginsPath怎麽用?Java PathManager.getPluginsPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.application.PathManager
的用法示例。
在下文中一共展示了PathManager.getPluginsPath方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPluginCustomPath
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Nullable
public static String getPluginCustomPath() {
String[] variants = { PathManager.getHomePath(), PathManager.getPluginsPath() };
for (String variant : variants) {
String path = variant + "/" + getProductId();
if (LocalFileSystem.getInstance().findFileByPath(path) != null) {
return path;
}
}
return null;
}
示例2: getPluginPath
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Nullable
public static String getPluginPath() {
String[] variants = { PathManager.getPluginsPath() };
for (String variant : variants) {
String path = variant + "/" + getProductId();
if (LocalFileSystem.getInstance().findFileByPath(path) != null) {
return path;
}
}
return null;
}
示例3: setLog4jProperties
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public void setLog4jProperties() {
File file =
new File(
PathManager.getPluginsPath()
+ "/tmc-plugin-intellij/lib/tmc-plugin-intellij.jar");
if (file.exists()) {
setPluginLog();
} else {
setDevLog();
}
}
示例4: setPluginLog
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private void setPluginLog() {
String jarPath =
PathManager.getPluginsPath() + "/tmc-plugin-intellij/lib/tmc-plugin-intellij.jar";
try {
JarFile jar = new JarFile(jarPath);
JarEntry entry = jar.getJarEntry("log4j.properties");
InputStream is = jar.getInputStream(entry);
PropertyConfigurator.configure(is);
} catch (IOException e) {
e.printStackTrace();
}
}
示例5: install
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public static void install(final File fromFile, final String pluginName, boolean deleteFromFile) throws IOException {
//noinspection HardCodedStringLiteral
if (fromFile.getName().endsWith(".jar")) {
// add command to copy file to the IDEA/plugins path
StartupActionScriptManager.ActionCommand copyPlugin =
new StartupActionScriptManager.CopyCommand(fromFile, new File(PathManager.getPluginsPath() + File.separator + fromFile.getName()));
StartupActionScriptManager.addActionCommand(copyPlugin);
}
else {
// add command to unzip file to the IDEA/plugins path
String unzipPath;
if (ZipUtil.isZipContainsFolder(fromFile)) {
unzipPath = PathManager.getPluginsPath();
}
else {
unzipPath = PathManager.getPluginsPath() + File.separator + pluginName;
}
StartupActionScriptManager.ActionCommand unzip = new StartupActionScriptManager.UnzipCommand(fromFile, new File(unzipPath));
StartupActionScriptManager.addActionCommand(unzip);
}
// add command to remove temp plugin file
if (deleteFromFile) {
StartupActionScriptManager.ActionCommand deleteTemp = new StartupActionScriptManager.DeleteCommand(fromFile);
StartupActionScriptManager.addActionCommand(deleteTemp);
}
}
示例6: loadCachedPlugins
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
/**
* Reads cached plugin descriptors from a file. Returns null if cache file does not exist.
*/
@Nullable
public static List<IdeaPluginDescriptor> loadCachedPlugins() throws IOException {
File file = new File(PathManager.getPluginsPath(), PLUGIN_LIST_FILE);
return file.length() == 0 ? null : loadPluginList(file);
}