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


Java PluginManager類代碼示例

本文整理匯總了Java中com.intellij.ide.plugins.PluginManager的典型用法代碼示例。如果您正苦於以下問題:Java PluginManager類的具體用法?Java PluginManager怎麽用?Java PluginManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PluginManager類屬於com.intellij.ide.plugins包,在下文中一共展示了PluginManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: projectOpened

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Override
public void projectOpened() {
    TYPO3CMSSettings instance = TYPO3CMSSettings.getInstance(project);
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("com.cedricziel.idea.typo3"));
    if (plugin == null) {
        return;
    }

    String version = instance.getVersion();
    if (version == null || !plugin.getVersion().equals(version)) {
        instance.setVersion(plugin.getVersion());

        FileBasedIndex index = FileBasedIndex.getInstance();
        index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable());
        index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable());
        index.scheduleRebuild(IconIndex.KEY, new Throwable());
        index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable());
        index.scheduleRebuild(RouteIndex.KEY, new Throwable());
        index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable());
        index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable());
        index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable());
        index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable());
    }
}
 
開發者ID:cedricziel,項目名稱:idea-php-typo3-plugin,代碼行數:25,代碼來源:TYPO3CMSProjectComponent.java

示例2: findAssociationForFile

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
/**
 * Find the Association for the given FileInfo
 *
 * @param file
 * @return
 */
@VisibleForTesting
@Nullable
protected Association findAssociationForFile(final FileInfo file) {
  Association result = null;
  for (final Association association : associations) {
    if (association.matches(file)) {
      result = association;
      break;
    }
  }

  if (result != null && result.getName().equals("Images")) {
    try {
      // Icon viewer plugin
      final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("ch.dasoft.iconviewer"));
      if (plugin != null) {
        return null;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  return result;
}
 
開發者ID:mallowigi,項目名稱:a-file-icon-idea,代碼行數:32,代碼來源:Associations.java

示例3: checkDependentPlugins

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
private void checkDependentPlugins() {
    final IdeaPluginDescriptor hybrisPlugin = PluginManager.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID));
    final PluginId[] dependentPluginIds = hybrisPlugin.getOptionalDependentPluginIds();
    Arrays.stream(dependentPluginIds).forEach(id -> {
        if (id.getIdString().startsWith(EXCLUDED_ID_PREFIX)) {
            return;
        }
        final boolean installed = PluginManager.isPluginInstalled(id);
        if (!installed) {
            notInstalledPlugins.add(id);
            return;
        }
        final IdeaPluginDescriptor plugin = PluginManager.getPlugin(id);
        if (!plugin.isEnabled()) {
            notEnabledPlugins.add(id);
        }
    });
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:19,代碼來源:CheckRequiredPluginsStep.java

示例4: populateComboBox

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
public void populateComboBox() {
    modifyFormComponentVisibility();

    // If the selector has already been populated, do not populate it again.
    if (versionComboBoxContains(VersionComboHeaders.INSTALLED.toString()) ||
            versionComboBoxContains(VersionComboHeaders.AVAILABLE.toString())) {
        return;
    }

    String relativeDependencyRootPath = DependencyResolutionBundle.key("dependency_root");
    File dependencyRoot = new File(PluginManager
            .getPlugin(PluginId.getId("org.idea.processing.plugin")).getPath(),
            relativeDependencyRootPath);

    // Populate the versions already installed.
    populateVersionSelectorWithInstalledVersions(dependencyRoot);

    logger.info("Querying Processing versions available for download.");

    // INVOKE
    populateVersionSelectorWithAvailableVersions(dependencyRoot);
}
 
開發者ID:mistodev,項目名稱:processing-idea,代碼行數:23,代碼來源:CustomVersionSelectorListener.java

示例5: addAgent

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
private void addAgent(com.samebug.clients.common.tracking.RawEvent e) {
    final Map<String, String> agent = new HashMap<String, String>();
    final LookAndFeel laf = UIManager.getLookAndFeel();
    final ApplicationInfo appInfo = ApplicationInfo.getInstance();
    final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(IdeaSamebugPlugin.ID));
    final String pluginVersion = plugin == null ? null : plugin.getVersion();
    final String instanceId = config.instanceId;

    agent.put("type", "ide-plugin");
    agent.put("ideCodeName", appInfo.getBuild().getProductCode());
    if (laf != null) agent.put("lookAndFeel", laf.getName());
    if (pluginVersion != null) agent.put("pluginVersion", pluginVersion);
    if (instanceId != null) agent.put("instanceId", instanceId);
    agent.put("isRetina", Boolean.toString(UIUtil.isRetina()));
    agent.put("ideBuild", appInfo.getApiVersion());
    e.withField("agent", agent);
}
 
開發者ID:samebug,項目名稱:samebug-idea-plugin,代碼行數:18,代碼來源:IdeaTrackingService.java

示例6: getDefaultProject

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Override
@NotNull
public synchronized Project getDefaultProject() {
  LOG.assertTrue(!myDefaultProjectWasDisposed, "Default project has been already disposed!");
  if (myDefaultProject == null) {
    ProgressManager.getInstance().executeNonCancelableSection(new Runnable() {
      @Override
      public void run() {
        try {
          myDefaultProject = createProject(null, "", true);
          initProject(myDefaultProject, null);
        }
        catch (Throwable t) {
          PluginManager.processException(t);
        }
      }
    });
  }
  return myDefaultProject;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:ProjectManagerImpl.java

示例7: loadOldPlugins

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
private static boolean loadOldPlugins(File plugins, File dest) throws IOException {
  if (plugins.exists()) {
    List<IdeaPluginDescriptorImpl> descriptors = new SmartList<IdeaPluginDescriptorImpl>();
    PluginManagerCore.loadDescriptors(plugins, descriptors, null, 0);
    List<String> oldPlugins = new SmartList<String>();
    for (IdeaPluginDescriptorImpl descriptor : descriptors) {
      // check isBundled also - probably plugin is bundled in new IDE version
      if (descriptor.isEnabled() && !descriptor.isBundled()) {
        oldPlugins.add(descriptor.getPluginId().getIdString());
      }
    }
    if (!oldPlugins.isEmpty()) {
      PluginManagerCore.savePluginsList(oldPlugins, false, new File(dest, PluginManager.INSTALLED_TXT));
    }
    return true;
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:ConfigImportHelper.java

示例8: getPluginResourcesRootName

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Nullable
private String getPluginResourcesRootName(VirtualFile resourcesDir) throws IOException {
  PluginId ownerPluginId = getOwner(resourcesDir);
  if (ownerPluginId == null) return null;

  if (PluginManagerCore.CORE_PLUGIN_ID.equals(ownerPluginId.getIdString())) {
    return PlatformUtils.getPlatformPrefix();
  }

  IdeaPluginDescriptor plugin = PluginManager.getPlugin(ownerPluginId);
  if (plugin != null) {
    return plugin.getName();
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:ExtensionsRootType.java

示例9: notify

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Override
public void notify(@NotNull Notification notification) {
    try {
        final ProjectManager projectManager = ProjectManager.getInstance();
        if(projectManager != null) {
            final Project[] openProjects = projectManager.getOpenProjects();
            if(openProjects.length == 0) {
                if(myModel != null) {
                    myModel.addNotification(notification);
                }
            }
            for(Project p : openProjects) {
                ConsoleLogProjectTracker consoleLogProjectTracker = getProjectComponent(p);
                if(consoleLogProjectTracker != null) {
                    consoleLogProjectTracker.printNotification(notification);
                }
            }
        } else {
            PluginManager.getLogger().error("Project Manager could not be retrieved");
        }
    } catch(Exception e) {
        PluginManager.getLogger().error("Could not Notify to Console Log Project Tracker", e);
    }
}
 
開發者ID:headwirecom,項目名稱:aem-ide-tooling-4-intellij,代碼行數:25,代碼來源:ConsoleLog.java

示例10: configureErrorFromEvent

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
private static void configureErrorFromEvent(IdeaLoggingEvent event, ErrorBean error) {
  Throwable throwable = event.getThrowable();
  if (throwable != null) {
    PluginId pluginId = IdeErrorsDialog.findPluginId(throwable);
    if (pluginId != null) {
      IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
      if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
        error.setPluginName(ideaPluginDescriptor.getName());
        error.setPluginVersion(ideaPluginDescriptor.getVersion());
      }
    }
  }

  Object data = event.getData();

  if (data instanceof AbstractMessage) {
    error.setAttachments(((AbstractMessage) data).getIncludedAttachments());
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-intellij,代碼行數:20,代碼來源:GoogleFeedbackErrorReporter.java

示例11: DisablePluginWarningDialog

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
public DisablePluginWarningDialog(
    @NotNull PluginId pluginId, @NotNull Component parentComponent) {
  super(parentComponent, false);

  this.pluginId = pluginId;
  IdeaPluginDescriptor plugin = PluginManager.getPlugin(pluginId);
  isRestartCapable = ApplicationManager.getApplication().isRestartCapable();
  promptLabel.setText(GctBundle.message("error.dialog.disable.plugin.prompt", plugin.getName()));
  restartLabel.setText(
      GctBundle.message(
          isRestartCapable
              ? "error.dialog.disable.plugin.restart"
              : "error.dialog.disable.plugin.norestart",
          ApplicationNamesInfo.getInstance().getFullProductName()));

  setTitle(GctBundle.message("error.dialog.disable.plugin.title"));
  init();
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-intellij,代碼行數:19,代碼來源:DisablePluginWarningDialog.java

示例12: initComponent

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Override
public void initComponent() {
  // The Pants plugin doesn't do so many computations for building a project
  // to start an external JVM each time.
  // The plugin only calls `export` goal and parses JSON response.
  // So it will be in process all the time.
  final String key = PantsConstants.SYSTEM_ID.getId() + ExternalSystemConstants.USE_IN_PROCESS_COMMUNICATION_REGISTRY_KEY_SUFFIX;
  Registry.get(key).setValue(true);

  // hack to trick BuildProcessClasspathManager
  final String basePath = System.getProperty("pants.plugin.base.path");
  final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PantsConstants.PLUGIN_ID));
  if (StringUtil.isNotEmpty(basePath) && plugin instanceof IdeaPluginDescriptorImpl) {
    ((IdeaPluginDescriptorImpl) plugin).setPath(new File(basePath));
  }

  registerPantsActions();
}
 
開發者ID:pantsbuild,項目名稱:intellij-pants-plugin,代碼行數:19,代碼來源:PantsInitComponentImpl.java

示例13: setupSdkPaths

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Override
public void setupSdkPaths(Sdk sdk)
{
	SdkModificator modificator = sdk.getSdkModificator();

	VirtualFile stubsDirectory = LocalFileSystem.getInstance().findFileByIoFile(new File(PluginManager.getPluginPath(NodeJSBundleType.class), "stubs"));
	if(stubsDirectory != null)
	{
		for(VirtualFile file : stubsDirectory.getChildren())
		{
			if(file.getFileType() == JavaScriptFileType.INSTANCE)
			{
				modificator.addRoot(file, BinariesOrderRootType.getInstance());
				modificator.addRoot(file, SourcesOrderRootType.getInstance());
			}
		}
	}

	modificator.commitChanges();
}
 
開發者ID:consulo,項目名稱:consulo-nodejs,代碼行數:21,代碼來源:NodeJSBundleType.java

示例14: start

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
/**
 * Called from PluginManager via reflection.
 */
protected static void start(final String[] args) {
  System.setProperty(PlatformUtilsCore.PLATFORM_PREFIX_KEY, PlatformUtils.getPlatformPrefix(PlatformUtils.COMMUNITY_PREFIX));

  StartupUtil.prepareAndStart(args, new StartupUtil.AppStarter() {
    @Override
    public void start(boolean newConfigFolder) {
      final IdeaApplication app = new IdeaApplication(args);
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          PluginManager.installExceptionHandler();
          app.run();
        }
      });
    }
  });
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:22,代碼來源:MainImpl.java

示例15: createHelpSet

import com.intellij.ide.plugins.PluginManager; //導入依賴的package包/類
@Nullable
private static HelpSet createHelpSet() {
  String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
  HelpSet mainHelpSet = loadHelpSet(urlToHelp);
  if (mainHelpSet == null) return null;

  // merge plugins help sets
  IdeaPluginDescriptor[] pluginDescriptors = PluginManager.getPlugins();
  for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
    HelpSetPath[] sets = pluginDescriptor.getHelpSets();
    for (HelpSetPath hsPath : sets) {
      String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
      if (!hsPath.getPath().startsWith("/")) {
        url += "/";
      }
      url += hsPath.getPath();
      HelpSet pluginHelpSet = loadHelpSet(url);
      if (pluginHelpSet != null) {
        mainHelpSet.add(pluginHelpSet);
      }
    }
  }

  return mainHelpSet;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:26,代碼來源:HelpManagerImpl.java


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