Search in sources :

Example 1 with JBDimension

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

the class TestStatusLine method setPreferredSize.

public void setPreferredSize(boolean orientation) {
    final Dimension size = new JBDimension(orientation ? 150 : 450, -1);
    myProgressPanel.setMaximumSize(size);
    myProgressPanel.setMinimumSize(size);
    myProgressPanel.setPreferredSize(size);
}
Also used : JBDimension(com.intellij.util.ui.JBDimension) JBDimension(com.intellij.util.ui.JBDimension)

Example 2 with JBDimension

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

the class SearchTextArea method createButton.

private static ActionButton createButton(AnAction action) {
    Presentation presentation = action.getTemplatePresentation();
    Dimension d = new JBDimension(16, 16);
    ActionButton button = new ActionButton(action, presentation, ActionPlaces.UNKNOWN, d) {

        @Override
        protected DataContext getDataContext() {
            return DataManager.getInstance().getDataContext(this);
        }
    };
    button.setLook(new InplaceActionButtonLook());
    button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    button.updateIcon();
    return button;
}
Also used : ActionButton(com.intellij.openapi.actionSystem.impl.ActionButton) JBDimension(com.intellij.util.ui.JBDimension) JBDimension(com.intellij.util.ui.JBDimension) InplaceActionButtonLook(com.intellij.openapi.actionSystem.impl.InplaceActionButtonLook)

Example 3 with JBDimension

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

the class AbstractNewProjectDialog method init.

@Override
protected void init() {
    super.init();
    DialogWrapperPeer peer = getPeer();
    JRootPane pane = peer.getRootPane();
    if (pane != null) {
        JBDimension size = JBUI.size(FlatWelcomeFrame.MAX_DEFAUL_WIDTH, FlatWelcomeFrame.DEFAULT_HEIGHT);
        pane.setMinimumSize(size);
        pane.setPreferredSize(size);
    }
}
Also used : DialogWrapperPeer(com.intellij.openapi.ui.DialogWrapperPeer) JBDimension(com.intellij.util.ui.JBDimension)

Example 4 with JBDimension

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

the class AbstractSchemesPanel method createUIComponents.

private void createUIComponents() {
    JPanel controlsPanel = new JPanel();
    controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.LINE_AXIS));
    controlsPanel.add(new JLabel(getSchemeTypeName() + ":"));
    controlsPanel.add(Box.createRigidArea(new JBDimension(10, 0)));
    myActions = createSchemeActions();
    mySchemesCombo = new EditableSchemesCombo<>(this);
    controlsPanel.add(mySchemesCombo.getComponent());
    myToolbar = createToolbar();
    controlsPanel.add(Box.createRigidArea(new JBDimension(6, 0)));
    controlsPanel.add(myToolbar);
    controlsPanel.add(Box.createRigidArea(new JBDimension(9, 0)));
    myInfoComponent = createInfoComponent();
    controlsPanel.add(myInfoComponent);
    controlsPanel.add(Box.createHorizontalGlue());
    controlsPanel.setMaximumSize(new Dimension(controlsPanel.getMaximumSize().width, mySchemesCombo.getComponent().getPreferredSize().height));
    add(controlsPanel);
    add(Box.createRigidArea(new JBDimension(0, 12)));
    add(new JSeparator());
    add(Box.createVerticalGlue());
    add(Box.createRigidArea(new JBDimension(0, 10)));
}
Also used : JBDimension(com.intellij.util.ui.JBDimension) JBDimension(com.intellij.util.ui.JBDimension)

Example 5 with JBDimension

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

the class MultilinePopupBuilder method createPopup.

@NotNull
JBPopup createPopup() {
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(myTextField, BorderLayout.CENTER);
    ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, myTextField).setCancelOnClickOutside(true).setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish").setRequestFocus(true).setResizable(true).setMayBeParent(true);
    final JBPopup popup = builder.createPopup();
    popup.setMinimumSize(new JBDimension(200, 90));
    AnAction okAction = new DumbAwareAction() {

        @Override
        public void actionPerformed(@NotNull AnActionEvent e) {
            unregisterCustomShortcutSet(popup.getContent());
            popup.closeOk(e.getInputEvent());
        }
    };
    okAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, popup.getContent());
    return popup;
}
Also used : ComponentPopupBuilder(com.intellij.openapi.ui.popup.ComponentPopupBuilder) JBDimension(com.intellij.util.ui.JBDimension) JBPopup(com.intellij.openapi.ui.popup.JBPopup) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction) DumbAwareAction(com.intellij.openapi.project.DumbAwareAction) NotNull(org.jetbrains.annotations.NotNull) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JBDimension (com.intellij.util.ui.JBDimension)5 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 ActionButton (com.intellij.openapi.actionSystem.impl.ActionButton)1 InplaceActionButtonLook (com.intellij.openapi.actionSystem.impl.InplaceActionButtonLook)1 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)1 DialogWrapperPeer (com.intellij.openapi.ui.DialogWrapperPeer)1 ComponentPopupBuilder (com.intellij.openapi.ui.popup.ComponentPopupBuilder)1 JBPopup (com.intellij.openapi.ui.popup.JBPopup)1 NotNull (org.jetbrains.annotations.NotNull)1