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);
}
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;
}
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);
}
}
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)));
}
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;
}
Aggregations