use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.
the class CodeStyleBlankLinesPanel method init.
@Override
protected void init() {
super.init();
JPanel optionsPanel = new JPanel(new GridBagLayout());
Map<CodeStyleSettingPresentation.SettingsGroup, List<CodeStyleSettingPresentation>> settings = CodeStyleSettingPresentation.getStandardSettings(getSettingsType());
OptionGroup keepBlankLinesOptionsGroup = createOptionsGroup(BLANK_LINES_KEEP, settings.get(new CodeStyleSettingPresentation.SettingsGroup(BLANK_LINES_KEEP)));
OptionGroup blankLinesOptionsGroup = createOptionsGroup(BLANK_LINES, settings.get(new CodeStyleSettingPresentation.SettingsGroup(BLANK_LINES)));
if (keepBlankLinesOptionsGroup != null) {
keepBlankLinesOptionsGroup.setAnchor(keepBlankLinesOptionsGroup.findAnchor());
optionsPanel.add(keepBlankLinesOptionsGroup.createPanel(), new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
}
if (blankLinesOptionsGroup != null) {
blankLinesOptionsGroup.setAnchor(blankLinesOptionsGroup.findAnchor());
optionsPanel.add(blankLinesOptionsGroup.createPanel(), new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
}
UIUtil.mergeComponentsWithAnchor(keepBlankLinesOptionsGroup, blankLinesOptionsGroup);
optionsPanel.add(new JPanel(), new GridBagConstraints(0, 2, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));
optionsPanel.setBorder(JBUI.Borders.empty(0, 10));
JScrollPane scroll = ScrollPaneFactory.createScrollPane(optionsPanel, true);
scroll.setMinimumSize(new Dimension(optionsPanel.getPreferredSize().width + scroll.getVerticalScrollBar().getPreferredSize().width + 5, -1));
scroll.setPreferredSize(scroll.getMinimumSize());
myPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));
final JPanel previewPanel = createPreviewPanel();
myPanel.add(previewPanel, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));
installPreviewPanel(previewPanel);
addPanelToWatch(myPanel);
myIsFirstUpdate = false;
}
use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.
the class ExportToHTMLDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
if (!myCanBeOpenInBrowser)
return null;
OptionGroup optionGroup = new OptionGroup();
addOptions(optionGroup);
return optionGroup.createPanel();
}
use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.
the class ExportToHTMLDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
OptionGroup optionGroup = new OptionGroup(CodeEditorBundle.message("export.to.html.options.group"));
myCbLineNumbers = new JCheckBox(CodeEditorBundle.message("export.to.html.options.show.line.numbers.checkbox"));
optionGroup.add(myCbLineNumbers);
for (UnnamedConfigurable printOption : myExtensions) {
optionGroup.add(printOption.createComponent());
}
myCbOpenInBrowser = new JCheckBox(CodeEditorBundle.message("export.to.html.open.generated.html.checkbox"));
optionGroup.add(myCbOpenInBrowser);
return optionGroup.createPanel();
}
use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.
the class ForceArrangementPanel method createPanel.
@NotNull
private JPanel createPanel() {
OptionGroup group = new OptionGroup(ApplicationBundle.message("arrangement.settings.additional.title"));
JPanel textWithComboPanel = new JPanel();
textWithComboPanel.setLayout(new BoxLayout(textWithComboPanel, BoxLayout.LINE_AXIS));
textWithComboPanel.add(new JLabel(ApplicationBundle.message("arrangement.settings.additional.force.combobox.name")));
textWithComboPanel.add(Box.createRigidArea(JBUI.size(5, 0)));
textWithComboPanel.add(myForceRearrangeComboBox);
group.add(textWithComboPanel);
return group.createPanel();
}
use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.
the class CodeStyleImportsPanelBase method createGeneralOptionsPanel.
private JPanel createGeneralOptionsPanel() {
OptionGroup group = new OptionGroup(ApplicationBundle.message("title.general"));
myCbUseSingleClassImports = new JCheckBox(ApplicationBundle.message("checkbox.use.single.class.import"));
group.add(myCbUseSingleClassImports);
myCbUseFQClassNames = new JCheckBox(ApplicationBundle.message("checkbox.use.fully.qualified.class.names"));
group.add(myCbUseFQClassNames);
myCbInsertInnerClassImports = new JCheckBox(ApplicationBundle.message("checkbox.insert.imports.for.inner.classes"));
group.add(myCbInsertInnerClassImports);
fillCustomOptions(group);
myClassCountField = new JTextField(3);
myNamesCountField = new JTextField(3);
final JPanel panel = new JPanel(new GridBagLayout());
panel.add(new JLabel(ApplicationBundle.message("editbox.class.count.to.use.import.with.star")), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsLeft(3), 0, 0));
panel.add(myClassCountField, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsLeft(1), 0, 0));
panel.add(new JLabel(ApplicationBundle.message("editbox.names.count.to.use.static.import.with.star")), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsLeft(3), 0, 0));
panel.add(myNamesCountField, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsLeft(1), 0, 0));
group.add(panel);
return group.createPanel();
}
Aggregations