Search in sources :

Example 1 with ShowSettingsUtil

use of com.intellij.openapi.options.ShowSettingsUtil in project intellij-community by JetBrains.

the class EditInspectionToolsSettingsAction method editSettings.

public static boolean editSettings(final Project project, final InspectionProfileImpl inspectionProfile, final Consumer<ErrorsConfigurable> configurableAction) {
    final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance();
    final ErrorsConfigurable errorsConfigurable = new ProjectInspectionToolsConfigurable(ProjectInspectionProfileManager.getInstance(project)) {

        @Override
        protected boolean setActiveProfileAsDefaultOnApply() {
            return false;
        }

        @Override
        protected InspectionProfileImpl getCurrentProfile() {
            return inspectionProfile;
        }
    };
    return settingsUtil.editConfigurable(project, errorsConfigurable, () -> configurableAction.accept(errorsConfigurable));
}
Also used : ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil) ErrorsConfigurable(com.intellij.profile.codeInspection.ui.ErrorsConfigurable) ProjectInspectionToolsConfigurable(com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable)

Example 2 with ShowSettingsUtil

use of com.intellij.openapi.options.ShowSettingsUtil 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)

Example 3 with ShowSettingsUtil

use of com.intellij.openapi.options.ShowSettingsUtil in project intellij-community by JetBrains.

the class AllFileTemplatesConfigurable method editCodeTemplate.

public static void editCodeTemplate(@NotNull final String templateId, Project project) {
    final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
    final AllFileTemplatesConfigurable configurable = new AllFileTemplatesConfigurable(project);
    util.editConfigurable(project, configurable, () -> {
        configurable.myTabbedPane.setSelectedIndex(ArrayUtil.indexOf(configurable.myTabs, configurable.myCodeTemplatesList));
        for (FileTemplate template : configurable.myCodeTemplatesList.getTemplates()) {
            if (Comparing.equal(templateId, template.getName())) {
                configurable.myCodeTemplatesList.selectTemplate(template);
                break;
            }
        }
    });
}
Also used : ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil)

Example 4 with ShowSettingsUtil

use of com.intellij.openapi.options.ShowSettingsUtil in project intellij-community by JetBrains.

the class CustomizeUIAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    final Project project = e.getData(CommonDataKeys.PROJECT);
    final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
    util.editConfigurable(project, new CustomizationConfigurable());
}
Also used : Project(com.intellij.openapi.project.Project) ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil) CustomizationConfigurable(com.intellij.ide.ui.customization.CustomizationConfigurable)

Example 5 with ShowSettingsUtil

use of com.intellij.openapi.options.ShowSettingsUtil in project android by JetBrains.

the class AndroidTemplateProjectStructureAction method actionPerformed.

@Override
public void actionPerformed(final AnActionEvent e) {
    Project project = ProjectManagerEx.getInstanceEx().getDefaultProject();
    AndroidProjectStructureConfigurable configurable = AndroidProjectStructureConfigurable.getInstance(project);
    ShowSettingsUtil settings = ShowSettingsUtil.getInstance();
    settings.editConfigurable(project, SettingsDialog.DIMENSION_KEY, configurable, true);
}
Also used : Project(com.intellij.openapi.project.Project) ShowSettingsUtil(com.intellij.openapi.options.ShowSettingsUtil) AndroidProjectStructureConfigurable(com.android.tools.idea.gradle.structure.AndroidProjectStructureConfigurable)

Aggregations

ShowSettingsUtil (com.intellij.openapi.options.ShowSettingsUtil)5 Project (com.intellij.openapi.project.Project)3 AndroidProjectStructureConfigurable (com.android.tools.idea.gradle.structure.AndroidProjectStructureConfigurable)1 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)1 PluginManagerConfigurable (com.intellij.ide.plugins.PluginManagerConfigurable)1 CustomizationConfigurable (com.intellij.ide.ui.customization.CustomizationConfigurable)1 PluginId (com.intellij.openapi.extensions.PluginId)1 ErrorsConfigurable (com.intellij.profile.codeInspection.ui.ErrorsConfigurable)1 ProjectInspectionToolsConfigurable (com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable)1 HyperlinkLabel (com.intellij.ui.HyperlinkLabel)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HyperlinkListener (javax.swing.event.HyperlinkListener)1 NonNls (org.jetbrains.annotations.NonNls)1