當前位置: 首頁>>代碼示例>>Java>>正文


Java PathManager.getPluginsPath方法代碼示例

本文整理匯總了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;
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:13,代碼來源:Plugin.java

示例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;
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:13,代碼來源:Plugin.java

示例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();
    }
}
 
開發者ID:testmycode,項目名稱:tmc-intellij,代碼行數:13,代碼來源:PropertySetter.java

示例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();
    }
}
 
開發者ID:testmycode,項目名稱:tmc-intellij,代碼行數:13,代碼來源:PropertySetter.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:PluginInstaller.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:RepositoryHelper.java


注:本文中的com.intellij.openapi.application.PathManager.getPluginsPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。