Search in sources :

Example 1 with PluginManagerConfigurable

use of com.intellij.ide.plugins.PluginManagerConfigurable in project intellij-community by JetBrains.

the class TraverseUIStarter method startup.

public static void startup(String outputPath) throws IOException {
    Map<SearchableConfigurable, Set<OptionDescription>> options = new LinkedHashMap<>();
    try {
        SearchUtil.processProjectConfigurables(ProjectManager.getInstance().getDefaultProject(), options);
        Element root = new Element(OPTIONS);
        for (SearchableConfigurable option : options.keySet()) {
            SearchableConfigurable configurable = option;
            Element configurableElement = new Element(CONFIGURABLE);
            String id = configurable.getId();
            configurableElement.setAttribute(ID, id);
            configurableElement.setAttribute(CONFIGURABLE_NAME, configurable.getDisplayName());
            Set<OptionDescription> sortedOptions = options.get(configurable);
            writeOptions(configurableElement, sortedOptions);
            if (configurable instanceof ConfigurableWrapper) {
                UnnamedConfigurable wrapped = ((ConfigurableWrapper) configurable).getConfigurable();
                if (wrapped instanceof SearchableConfigurable) {
                    configurable = (SearchableConfigurable) wrapped;
                }
            }
            if (configurable instanceof KeymapPanel) {
                processKeymap(configurableElement);
            } else if (configurable instanceof OptionsContainingConfigurable) {
                processOptionsContainingConfigurable((OptionsContainingConfigurable) configurable, configurableElement);
            } else if (configurable instanceof PluginManagerConfigurable) {
                for (OptionDescription description : wordsToOptionDescriptors(Collections.singleton(AvailablePluginsManagerMain.MANAGE_REPOSITORIES))) {
                    append(null, AvailablePluginsManagerMain.MANAGE_REPOSITORIES, description.getOption(), configurableElement);
                }
            } else if (configurable instanceof AllFileTemplatesConfigurable) {
                processFileTemplates(configurableElement);
            }
            root.addContent(configurableElement);
        }
        FileUtil.ensureCanCreateFile(new File(outputPath));
        JDOMUtil.writeDocument(new Document(root), outputPath, "\n");
        System.out.println("Searchable options index builder completed");
    } finally {
        for (SearchableConfigurable configurable : options.keySet()) {
            configurable.disposeUIResources();
        }
    }
}
Also used : OptionsContainingConfigurable(com.intellij.application.options.OptionsContainingConfigurable) ConfigurableWrapper(com.intellij.openapi.options.ex.ConfigurableWrapper) KeymapPanel(com.intellij.openapi.keymap.impl.ui.KeymapPanel) Element(org.jdom.Element) UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable) Document(org.jdom.Document) PluginManagerConfigurable(com.intellij.ide.plugins.PluginManagerConfigurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) AllFileTemplatesConfigurable(com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable) File(java.io.File)

Example 2 with PluginManagerConfigurable

use of com.intellij.ide.plugins.PluginManagerConfigurable in project intellij-community by JetBrains.

the class ShowPluginManagerAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    Component component = e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
    final PluginManagerConfigurable configurable = new PluginManagerConfigurable(PluginManagerUISettings.getInstance());
    ShowSettingsUtil.getInstance().editConfigurable(component, configurable);
}
Also used : PluginManagerConfigurable(com.intellij.ide.plugins.PluginManagerConfigurable)

Example 3 with PluginManagerConfigurable

use of com.intellij.ide.plugins.PluginManagerConfigurable in project intellij-community by JetBrains.

the class IntentionDescriptionPanel method setupPoweredByPanel.

private void setupPoweredByPanel(final IntentionActionMetaData actionMetaData) {
    PluginId pluginId = actionMetaData == null ? null : actionMetaData.getPluginId();
    JComponent owner;
    if (pluginId == null) {
        @NonNls String label = XmlStringUtil.wrapInHtml("<b>" + ApplicationNamesInfo.getInstance().getFullProductName() + "</b>");
        owner = new JLabel(label);
    } else {
        final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(pluginId);
        HyperlinkLabel label = new HyperlinkLabel(CodeInsightBundle.message("powered.by.plugin", pluginDescriptor.getName()));
        label.addHyperlinkListener(new HyperlinkListener() {

            @Override
            public void hyperlinkUpdate(HyperlinkEvent e) {
                final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
                final PluginManagerConfigurable pluginConfigurable = new PluginManagerConfigurable(PluginManagerUISettings.getInstance());
                final Project project = ProjectManager.getInstance().getDefaultProject();
                util.editConfigurable(project, pluginConfigurable, () -> pluginConfigurable.select(pluginDescriptor));
            }
        });
        owner = label;
    }
    //myPoweredByContainer.setVisible(true);
    myPoweredByPanel.removeAll();
    myPoweredByPanel.add(owner, BorderLayout.CENTER);
}
Also used : NonNls(org.jetbrains.annotations.NonNls) HyperlinkEvent(javax.swing.event.HyperlinkEvent) ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil) IdeaPluginDescriptor(com.intellij.ide.plugins.IdeaPluginDescriptor) PluginId(com.intellij.openapi.extensions.PluginId) PluginManagerConfigurable(com.intellij.ide.plugins.PluginManagerConfigurable) Project(com.intellij.openapi.project.Project) HyperlinkListener(javax.swing.event.HyperlinkListener) HyperlinkLabel(com.intellij.ui.HyperlinkLabel)

Aggregations

PluginManagerConfigurable (com.intellij.ide.plugins.PluginManagerConfigurable)3 OptionsContainingConfigurable (com.intellij.application.options.OptionsContainingConfigurable)1 AllFileTemplatesConfigurable (com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable)1 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)1 PluginId (com.intellij.openapi.extensions.PluginId)1 KeymapPanel (com.intellij.openapi.keymap.impl.ui.KeymapPanel)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 ShowSettingsUtil (com.intellij.openapi.options.ShowSettingsUtil)1 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)1 ConfigurableWrapper (com.intellij.openapi.options.ex.ConfigurableWrapper)1 Project (com.intellij.openapi.project.Project)1 HyperlinkLabel (com.intellij.ui.HyperlinkLabel)1 File (java.io.File)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HyperlinkListener (javax.swing.event.HyperlinkListener)1 Document (org.jdom.Document)1 Element (org.jdom.Element)1 NonNls (org.jetbrains.annotations.NonNls)1