Example usage for com.intellij.openapi.options ShowSettingsUtil editConfigurable

List of usage examples for com.intellij.openapi.options ShowSettingsUtil editConfigurable

Introduction

In this page you can find the example usage for com.intellij.openapi.options ShowSettingsUtil editConfigurable.

Prototype

public abstract boolean editConfigurable(Component parent, @NonNls @NotNull String dimensionServiceKey,
            @NotNull Configurable configurable);

Source Link

Usage

From source file:com.intellij.codeInsight.intention.impl.config.IntentionDescriptionPanel.java

License:Apache License

private void setupPoweredByPanel(final IntentionActionMetaData actionMetaData) {
    PluginId pluginId = actionMetaData == null ? null : actionMetaData.getPluginId();
    JComponent owner;//from   w  w w .j  ava 2s  . c  o m
    if (pluginId == null) {
        @NonNls
        String label = "<html><body><b>" + ApplicationNamesInfo.getInstance().getFullProductName()
                + "</b></body></html>";
        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, new Runnable() {
                    @Override
                    public void run() {
                        pluginConfigurable.select(pluginDescriptor);
                    }
                });
            }
        });
        owner = label;
    }
    //myPoweredByContainer.setVisible(true);
    myPoweredByPanel.removeAll();
    myPoweredByPanel.add(owner, BorderLayout.CENTER);
}

From source file:com.intellij.codeInspection.ex.EditInspectionToolsSettingsAction.java

License:Apache License

public static boolean editToolSettings(final Project project, final InspectionProfile inspectionProfile,
        final boolean canChooseDifferentProfile, final String selectedToolShortName) {
    final ShowSettingsUtil settingsUtil = ShowSettingsUtil.getInstance();
    final ErrorsConfigurable errorsConfigurable;
    if (!canChooseDifferentProfile) {
        errorsConfigurable = new IDEInspectionToolsConfigurable(
                InspectionProjectProfileManager.getInstance(project), InspectionProfileManager.getInstance());
    } else {/*from ww w . j  a  v  a  2s . c  om*/
        errorsConfigurable = ErrorsConfigurable.SERVICE.createConfigurable(project);
    }
    return settingsUtil.editConfigurable(project, errorsConfigurable, new Runnable() {
        @Override
        public void run() {
            errorsConfigurable.selectProfile(inspectionProfile);
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    errorsConfigurable.selectInspectionTool(selectedToolShortName);
                }
            });
        }
    });

}