Search in sources :

Example 1 with JBEmptyBorder

use of com.intellij.util.ui.JBEmptyBorder in project intellij-community by JetBrains.

the class PluginConflictDialog method getChooserPanelForPlugin.

@NotNull
private JPanel getChooserPanelForPlugin(@NotNull ButtonGroup buttonGroup, @Nullable PluginId plugin) {
    final JPanel panel = new JPanel(new BorderLayout());
    if (!myIsConflictWithPlatform) {
        assert myRadioButtons != null;
        final JBRadioButton radioButton = new JBRadioButton();
        myRadioButtons.add(radioButton);
        buttonGroup.add(radioButton);
        radioButton.addChangeListener(e -> getOKAction().updateText());
        panel.add(radioButton, BorderLayout.WEST);
        panel.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                radioButton.setSelected(true);
            }
        });
    }
    final JPanel descriptionPanel;
    if (plugin != null) {
        descriptionPanel = getPluginDescriptionPanel(plugin, !myIsConflictWithPlatform);
    } else {
        descriptionPanel = getDisableAllPanel();
    }
    descriptionPanel.setBorder(new JBEmptyBorder(10, myIsConflictWithPlatform ? 10 : 0, 10, 20));
    panel.add(descriptionPanel, BorderLayout.CENTER);
    return panel;
}
Also used : MouseEvent(java.awt.event.MouseEvent) JBEmptyBorder(com.intellij.util.ui.JBEmptyBorder) JBRadioButton(com.intellij.ui.components.JBRadioButton) MouseAdapter(java.awt.event.MouseAdapter) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with JBEmptyBorder

use of com.intellij.util.ui.JBEmptyBorder in project intellij-plugins by JetBrains.

the class SplitEditorToolbar method createToolbarFromGroupId.

@NotNull
private static ActionToolbar createToolbarFromGroupId(@NotNull String groupId) {
    final ActionManager actionManager = ActionManager.getInstance();
    if (!actionManager.isGroup(groupId)) {
        throw new IllegalStateException(groupId + " should have been a group");
    }
    final ActionGroup group = ((ActionGroup) actionManager.getAction(groupId));
    final ActionToolbarImpl editorToolbar = ((ActionToolbarImpl) actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
    editorToolbar.setOpaque(false);
    editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));
    return editorToolbar;
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) JBEmptyBorder(com.intellij.util.ui.JBEmptyBorder) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) ActionToolbarImpl(com.intellij.openapi.actionSystem.impl.ActionToolbarImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JBEmptyBorder (com.intellij.util.ui.JBEmptyBorder)2 NotNull (org.jetbrains.annotations.NotNull)2 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 ActionManager (com.intellij.openapi.actionSystem.ActionManager)1 ActionToolbarImpl (com.intellij.openapi.actionSystem.impl.ActionToolbarImpl)1 JBRadioButton (com.intellij.ui.components.JBRadioButton)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1