use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.
the class ValueMarkerPresentationDialogBase method createUIComponents.
private void createUIComponents() {
myColorSample = new SimpleColoredComponent();
mySamplePanel = new JPanel(new BorderLayout());
mySamplePanel.setBorder(BorderFactory.createEtchedBorder());
mySamplePanel.add(BorderLayout.CENTER, myColorSample);
myChooseColorButton = new FixedSizeButton(mySamplePanel);
}
use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.
the class ToolEditorDialog method createCommandPane.
private JPanel createCommandPane() {
final JPanel pane = new JPanel(new GridBagLayout());
pane.setBorder(IdeBorderFactory.createTitledBorder(ToolsBundle.message("tools.tool.group"), true));
GridBagConstraints constr;
// program
constr = new GridBagConstraints();
constr.gridx = 0;
constr.gridy = 0;
constr.insets = new Insets(0, 0, 0, 10);
constr.anchor = GridBagConstraints.BASELINE_LEADING;
pane.add(new JLabel(ToolsBundle.message("tools.program.label")), constr);
FixedSizeButton browseCommandButton = new FixedSizeButton(myTfCommand);
addCommandBrowseAction(pane, browseCommandButton, myTfCommand);
JPanel _pane0 = new JPanel(new BorderLayout());
_pane0.add(myTfCommand, BorderLayout.CENTER);
_pane0.add(browseCommandButton, BorderLayout.EAST);
TextFieldWithBrowseButton.MyDoClickAction.addTo(browseCommandButton, myTfCommand);
constr = new GridBagConstraints();
constr.gridx = 1;
constr.gridy = 0;
constr.insets = new Insets(0, 0, 0, 10);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.BASELINE_LEADING;
constr.weightx = 1.0;
pane.add(_pane0, constr);
constr = new GridBagConstraints();
constr.gridx = 2;
constr.gridy = 0;
constr.insets = new Insets(0, 0, 0, 0);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.BASELINE_LEADING;
myInsertCommandMacroButton = new JButton(ToolsBundle.message("tools.insert.macro.button"));
pane.add(myInsertCommandMacroButton, constr);
// parameters
constr = new GridBagConstraints();
constr.gridx = 0;
constr.gridy = 1;
constr.insets = new Insets(5, 0, 0, 10);
constr.anchor = GridBagConstraints.BASELINE_LEADING;
pane.add(new JLabel(ToolsBundle.message("tools.parameters.label")), constr);
constr = new GridBagConstraints();
constr.gridx = 1;
constr.gridy = 1;
constr.insets = new Insets(5, 0, 0, 10);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.BASELINE_LEADING;
constr.weightx = 1.0;
pane.add(myParametersField, constr);
constr = new GridBagConstraints();
constr.gridx = 2;
constr.gridy = 1;
constr.insets = new Insets(5, 0, 0, 0);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.BASELINE_LEADING;
myInsertParametersMacroButton = new JButton(ToolsBundle.message("tools.insert.macro.button.a"));
pane.add(myInsertParametersMacroButton, constr);
// working directory
constr = new GridBagConstraints();
constr.gridx = 0;
constr.gridy = 2;
constr.insets = new Insets(5, 0, 0, 10);
constr.anchor = GridBagConstraints.BASELINE_LEADING;
pane.add(new JLabel(ToolsBundle.message("tools.working.directory.label")), constr);
FixedSizeButton browseDirectoryButton = new FixedSizeButton(myTfCommandWorkingDirectory);
TextFieldWithBrowseButton.MyDoClickAction.addTo(browseDirectoryButton, myTfCommandWorkingDirectory);
addWorkingDirectoryBrowseAction(pane, browseDirectoryButton, myTfCommandWorkingDirectory);
JPanel _pane1 = new JPanel(new BorderLayout());
_pane1.add(myTfCommandWorkingDirectory, BorderLayout.CENTER);
_pane1.add(browseDirectoryButton, BorderLayout.EAST);
constr = new GridBagConstraints();
constr.gridx = 1;
constr.gridy = 2;
constr.gridwidth = 1;
constr.insets = new Insets(5, 0, 0, 10);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.WEST;
constr.weightx = 1.0;
pane.add(_pane1, constr);
constr = new GridBagConstraints();
constr.gridx = 2;
constr.gridy = 2;
constr.insets = new Insets(5, 0, 0, 0);
constr.fill = GridBagConstraints.HORIZONTAL;
constr.anchor = GridBagConstraints.BASELINE_LEADING;
myInsertWorkingDirectoryMacroButton = new JButton(ToolsBundle.message("tools.insert.macro.button.c"));
pane.add(myInsertWorkingDirectoryMacroButton, constr);
// for normal resizing
constr = new GridBagConstraints();
constr.gridy = 3;
constr.fill = GridBagConstraints.BASELINE_LEADING;
constr.weighty = 1.0;
pane.add(new JLabel(), constr);
return pane;
}
use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.
the class GuiUtils method constructFieldWithBrowseButton.
private static JPanel constructFieldWithBrowseButton(final JComponent aComponent, final ActionListener aActionListener, int delta) {
JPanel result = new JPanel(new GridBagLayout());
result.add(aComponent, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
//ignore border in case of browse button
FixedSizeButton browseButton = new FixedSizeButton(aComponent.getPreferredSize().height - delta);
TextFieldWithBrowseButton.MyDoClickAction.addTo(browseButton, aComponent);
result.add(browseButton, new GridBagConstraints(1, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
browseButton.addActionListener(aActionListener);
return result;
}
use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.
the class SvnMergeInfoRootPanelManual method init.
private void init() {
myContentPanel = new JPanel(new GridBagLayout()) {
@Override
public void setBounds(final Rectangle r) {
super.setBounds(r);
}
};
myContentPanel.setMinimumSize(new Dimension(200, 100));
final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(1), 0, 0);
myInclude = new JCheckBox();
gb.fill = GridBagConstraints.NONE;
gb.weightx = 0;
myContentPanel.add(myInclude, gb);
// newline
JLabel hereLabel = new JLabel("From:");
++gb.gridy;
gb.gridx = 0;
myContentPanel.add(hereLabel, gb);
myUrlText = new JTextArea();
myUrlText.setLineWrap(true);
myUrlText.setBackground(UIUtil.getLabelBackground());
myUrlText.setWrapStyleWord(true);
gb.weightx = 1;
++gb.gridx;
gb.gridwidth = 2;
gb.fill = GridBagConstraints.HORIZONTAL;
myContentPanel.add(myUrlText, gb);
// newline
gb.fill = GridBagConstraints.NONE;
JLabel thereLabel = new JLabel("To:");
gb.weightx = 0;
gb.gridwidth = 1;
++gb.gridy;
gb.gridx = 0;
myContentPanel.add(thereLabel, gb);
myBranchField = new TextFieldWithBrowseButton();
gb.weightx = 1;
++gb.gridx;
gb.gridwidth = 2;
gb.fill = GridBagConstraints.HORIZONTAL;
myContentPanel.add(myBranchField, gb);
// newline
gb.gridx = 1;
++gb.gridy;
gb.gridwidth = 1;
myLocalArea = new JTextArea();
myLocalArea.setBackground(UIUtil.getLabelBackground());
myLocalArea.setLineWrap(true);
myLocalArea.setWrapStyleWord(true);
myContentPanel.add(myLocalArea, gb);
++gb.gridx;
gb.weightx = 0;
gb.fill = GridBagConstraints.NONE;
myFixedSelectLocal = new FixedSizeButton(20);
myContentPanel.add(myFixedSelectLocal, gb);
++gb.gridy;
gb.gridx = 0;
gb.gridwidth = 2;
myMixedRevisions = new JTextArea("Mixed Revision Working Copy");
myMixedRevisions.setForeground(JBColor.RED);
myMixedRevisions.setBackground(myContentPanel.getBackground());
myContentPanel.add(myMixedRevisions, gb);
myMixedRevisions.setVisible(false);
}
use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.
the class GroovyCreateClassDialog method createUIComponents.
private void createUIComponents() {
myPackageTextField = new EditorTextField();
myPackageChooseButton = new FixedSizeButton(myPackageTextField);
}
Aggregations