use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class ConsoleConfigurable method createComponent.
@Override
public JComponent createComponent() {
if (myMainComponent == null) {
myMainComponent = new JPanel(new BorderLayout());
myCbUseSoftWrapsAtConsole = new JCheckBox(ApplicationBundle.message("checkbox.use.soft.wraps.at.console"), false);
myCommandsHistoryLimitField = new JTextField(3);
myCbOverrideConsoleCycleBufferSize = new JCheckBox(ApplicationBundle.message("checkbox.override.console.cycle.buffer.size", String.valueOf(ConsoleBuffer.getLegacyCycleBufferSize() / 1024)), false);
myCbOverrideConsoleCycleBufferSize.addChangeListener(e -> myConsoleCycleBufferSizeField.setEnabled(myCbOverrideConsoleCycleBufferSize.isSelected()));
myConsoleCycleBufferSizeField = new JTextField(3);
JPanel northPanel = new JPanel(new GridBagLayout());
GridBag gridBag = new GridBag();
gridBag.anchor(GridBagConstraints.WEST).setDefaultAnchor(GridBagConstraints.WEST);
northPanel.add(myCbUseSoftWrapsAtConsole, gridBag.nextLine().next());
northPanel.add(Box.createHorizontalGlue(), gridBag.next().coverLine());
northPanel.add(new JLabel(ApplicationBundle.message("editbox.console.history.limit")), gridBag.nextLine().next());
northPanel.add(myCommandsHistoryLimitField, gridBag.next());
if (ConsoleBuffer.useCycleBuffer()) {
northPanel.add(myCbOverrideConsoleCycleBufferSize, gridBag.nextLine().next());
northPanel.add(myConsoleCycleBufferSizeField, gridBag.next());
northPanel.add(new JLabel(" KB"), gridBag.next());
}
if (!editFoldingsOnly()) {
JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(northPanel, BorderLayout.WEST);
myMainComponent.add(wrapper, BorderLayout.NORTH);
}
Splitter splitter = new Splitter(true);
myMainComponent.add(splitter, BorderLayout.CENTER);
myPositivePanel = new MyAddDeleteListPanel("Fold console lines that contain", "Enter a substring of a console line you'd like to see folded:");
myNegativePanel = new MyAddDeleteListPanel("Exceptions", "Enter a substring of a console line you don't want to fold:");
splitter.setFirstComponent(myPositivePanel);
splitter.setSecondComponent(myNegativePanel);
myPositivePanel.getEmptyText().setText("Fold nothing");
myNegativePanel.getEmptyText().setText("No exceptions");
}
return myMainComponent;
}
use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class ArrangementMatchingRuleEditor method addRowIfNecessary.
@NotNull
private MultiRowFlowPanel addRowIfNecessary(@NotNull MultiRowFlowPanel panel) {
if (panel.getComponentCount() <= 0) {
return panel;
}
add(panel, new GridBag().anchor(GridBagConstraints.WEST).weightx(1).fillCellHorizontally().coverLine());
myRows.add(panel);
return new MultiRowFlowPanel(FlowLayout.LEFT, ArrangementConstants.HORIZONTAL_GAP, ArrangementConstants.VERTICAL_GAP);
}
use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class ArrangementGroupingComponent method init.
private void init() {
setLayout(new GridBagLayout());
add(myRowIndexControl, new GridBag().anchor(GridBagConstraints.CENTER).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, ArrangementConstants.HORIZONTAL_GAP * 2));
add(myGroupingTypeToken.getUiComponent(), new GridBag().anchor(GridBagConstraints.WEST).insets(0, 0, 0, 2));
if (myOrderTypeToken != null) {
add(myOrderTypeToken.getUiComponent(), new GridBag().anchor(GridBagConstraints.WEST));
}
add(new JLabel(" "), new GridBag().weightx(1).fillCellHorizontally());
setBackground(UIUtil.getListBackground());
setBorder(IdeBorderFactory.createEmptyBorder(ArrangementConstants.VERTICAL_GAP));
setOpaque(!UIUtil.isUnderIntelliJLaF() && !UIUtil.isUnderNativeMacLookAndFeel() && !UIUtil.isUnderDarcula());
}
use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class ExternalSystemTaskSettingsControl method fillUi.
@Override
public void fillUi(@NotNull final PaintAwarePanel canvas, int indentLevel) {
myProjectPathLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.project", myExternalSystemId.getReadableName()));
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId);
FileChooserDescriptor projectPathChooserDescriptor = null;
if (manager instanceof ExternalSystemUiAware) {
projectPathChooserDescriptor = ((ExternalSystemUiAware) manager).getExternalProjectConfigDescriptor();
}
if (projectPathChooserDescriptor == null) {
projectPathChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
}
String title = ExternalSystemBundle.message("settings.label.select.project", myExternalSystemId.getReadableName());
myProjectPathField = new ExternalProjectPathField(myProject, myExternalSystemId, projectPathChooserDescriptor, title) {
@Override
public Dimension getPreferredSize() {
return myVmOptionsEditor == null ? super.getPreferredSize() : myVmOptionsEditor.getTextField().getPreferredSize();
}
};
canvas.add(myProjectPathLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myProjectPathField, ExternalSystemUiUtil.getFillLineConstraints(0));
myTasksLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.tasks"));
myTasksTextField = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
canvas.add(myTasksLabel, ExternalSystemUiUtil.getLabelConstraints(0));
GridBag c = ExternalSystemUiUtil.getFillLineConstraints(0);
c.insets.right = myProjectPathField.getButton().getPreferredSize().width + 8;
canvas.add(myTasksTextField, c);
new TaskCompletionProvider(myProject, myExternalSystemId, myProjectPathField).apply(myTasksTextField);
myVmOptionsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
myVmOptionsEditor = new RawCommandLineEditor();
myVmOptionsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
canvas.add(myVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myVmOptionsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
myArgumentsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
myArgumentsEditor = new RawCommandLineEditor();
myArgumentsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
canvas.add(myArgumentsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myArgumentsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
}
use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class GithubRepositoryEditor method createCustomPanel.
@Nullable
@Override
protected JComponent createCustomPanel() {
myHostLabel = new JBLabel("Host:", SwingConstants.RIGHT);
JPanel myHostPanel = new JPanel(new BorderLayout(5, 0));
myHostPanel.add(myURLText, BorderLayout.CENTER);
myHostPanel.add(myShareUrlCheckBox, BorderLayout.EAST);
myRepositoryLabel = new JBLabel("Repository:", SwingConstants.RIGHT);
myRepoAuthor = new MyTextField("Repository Owner");
myRepoName = new MyTextField("Repository Name");
myRepoAuthor.setPreferredSize("SomelongNickname");
myRepoName.setPreferredSize("SomelongReponame-with-suffixes");
JPanel myRepoPanel = new JPanel(new GridBagLayout());
GridBag bag = new GridBag().setDefaultWeightX(1).setDefaultFill(GridBagConstraints.HORIZONTAL);
myRepoPanel.add(myRepoAuthor, bag.nextLine().next());
myRepoPanel.add(new JLabel("/"), bag.next().fillCellNone().insets(0, 5, 0, 5).weightx(0));
myRepoPanel.add(myRepoName, bag.next());
myTokenLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
myToken = new MyTextField("OAuth2 token");
myTokenButton = new JButton("Create API token");
myTokenButton.addActionListener(e -> {
generateToken();
doApply();
});
JPanel myTokenPanel = new JPanel();
myTokenPanel.setLayout(new BorderLayout(5, 5));
myTokenPanel.add(myToken, BorderLayout.CENTER);
myTokenPanel.add(myTokenButton, BorderLayout.EAST);
myShowNotAssignedIssues = new JBCheckBox("Include issues not assigned to me");
installListener(myRepoAuthor);
installListener(myRepoName);
installListener(myToken);
installListener(myShowNotAssignedIssues);
return FormBuilder.createFormBuilder().setAlignLabelOnRight(true).addLabeledComponent(myHostLabel, myHostPanel).addLabeledComponent(myRepositoryLabel, myRepoPanel).addLabeledComponent(myTokenLabel, myTokenPanel).addComponentToRightColumn(myShowNotAssignedIssues).getPanel();
}
Aggregations