本文整理汇总了Java中com.intellij.ui.OptionGroup类的典型用法代码示例。如果您正苦于以下问题:Java OptionGroup类的具体用法?Java OptionGroup怎么用?Java OptionGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OptionGroup类属于com.intellij.ui包,在下文中一共展示了OptionGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBlankLinesOptionsGroup
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Nullable
private OptionGroup createBlankLinesOptionsGroup() {
OptionGroup optionGroup = new OptionGroup(BLANK_LINES);
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.package.statement"), "BLANK_LINES_BEFORE_PACKAGE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.package.statement"), "BLANK_LINES_AFTER_PACKAGE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.imports"), "BLANK_LINES_BEFORE_IMPORTS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.imports"), "BLANK_LINES_AFTER_IMPORTS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.class"), "BLANK_LINES_AROUND_CLASS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.class.header"), "BLANK_LINES_AFTER_CLASS_HEADER");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.anonymous.class.header"),
"BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER");
createOption(optionGroup, "Around field in interface:", "BLANK_LINES_AROUND_FIELD_IN_INTERFACE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.field"), "BLANK_LINES_AROUND_FIELD");
createOption(optionGroup, "Around method in interface:", "BLANK_LINES_AROUND_METHOD_IN_INTERFACE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.method"), "BLANK_LINES_AROUND_METHOD");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.method.body"), "BLANK_LINES_BEFORE_METHOD_BODY");
initCustomOptions(optionGroup, BLANK_LINES);
if (optionGroup.getComponents().length == 0) return null;
return optionGroup;
}
示例2: createCenterPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@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();
}
示例3: createBlankLinesOptionsGroup
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Nullable
private OptionGroup createBlankLinesOptionsGroup() {
OptionGroup optionGroup = new OptionGroup(BLANK_LINES);
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.package.statement"), "BLANK_LINES_BEFORE_PACKAGE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.package.statement"), "BLANK_LINES_AFTER_PACKAGE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.imports"), "BLANK_LINES_BEFORE_IMPORTS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.imports"), "BLANK_LINES_AFTER_IMPORTS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.class"), "BLANK_LINES_AROUND_CLASS");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.class.header"), "BLANK_LINES_AFTER_CLASS_HEADER");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.anonymous.class.header"),
"BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER");
createOption(optionGroup, "Around field in interface:", "BLANK_LINES_AROUND_FIELD_IN_INTERFACE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.field"), "BLANK_LINES_AROUND_FIELD");
createOption(optionGroup, "Around method in interface:", "BLANK_LINES_AROUND_METHOD_IN_INTERFACE");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.method"), "BLANK_LINES_AROUND_METHOD");
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.method.body"), "BLANK_LINES_BEFORE_METHOD_BODY");
initCustomOptions(optionGroup, BLANK_LINES);
if (optionGroup.getComponents().length == 0) return null;
return optionGroup;
}
示例4: createNorthPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
OptionGroup optionGroup = new OptionGroup();
myTargetDirectoryField = new TextFieldWithBrowseButton();
optionGroup.add(com.intellij.codeEditor.printing.ExportToHTMLDialog.assignLabel(myTargetDirectoryField, myProject));
return optionGroup.createPanel();
}
示例5: createCenterPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
if (!myCanBeOpenInBrowser) return null;
OptionGroup optionGroup = new OptionGroup();
addOptions(optionGroup);
return optionGroup.createPanel();
}
示例6: createKeepBlankLinesOptionsGroup
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Nullable
private OptionGroup createKeepBlankLinesOptionsGroup() {
OptionGroup optionGroup = new OptionGroup(BLANK_LINES_KEEP);
createOption(optionGroup, ApplicationBundle.message("editbox.keep.blanklines.in.declarations"), "KEEP_BLANK_LINES_IN_DECLARATIONS");
createOption(optionGroup, ApplicationBundle.message("editbox.keep.blanklines.in.code"), "KEEP_BLANK_LINES_IN_CODE");
createOption(optionGroup, ApplicationBundle.message("editbox.keep.blanklines.before.rbrace"), "KEEP_BLANK_LINES_BEFORE_RBRACE");
initCustomOptions(optionGroup, BLANK_LINES_KEEP);
if (optionGroup.getComponents().length == 0) return null;
return optionGroup;
}
示例7: doCreateOption
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
private void doCreateOption(OptionGroup optionGroup, String title, IntOption option, String fieldName) {
String renamed = myRenamedFields.get(fieldName);
if (renamed != null) title = renamed;
JBLabel l = new JBLabel(title);
optionGroup.add(l, option.myTextField);
myOptions.add(option);
}
示例8: createPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@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();
}
示例9: createPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Nonnull
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(new Dimension(5, 0)));
textWithComboPanel.add(myForceRearrangeComboBox);
group.add(textWithComboPanel);
return group.createPanel();
}
示例10: addOptions
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
protected void addOptions(OptionGroup optionGroup) {
myCbOpenInBrowser = new JCheckBox();
myCbOpenInBrowser.setText(InspectionsBundle.message("inspection.export.open.option"));
optionGroup.add(myCbOpenInBrowser);
}
示例11: init
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Override
protected void init() {
super.init();
JPanel optionsPanel = new JPanel(new GridBagLayout());
OptionGroup keepBlankLinesOptionsGroup = createKeepBlankLinesOptionsGroup();
OptionGroup blankLinesOptionsGroup = createBlankLinesOptionsGroup();
if (keepBlankLinesOptionsGroup != null) {
keepBlankLinesOptionsGroup.setAnchor(keepBlankLinesOptionsGroup.findAnchor());
optionsPanel.add(keepBlankLinesOptionsGroup.createPanel(),
new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0), 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,
new Insets(0, 0, 0, 0), 0, 0));
}
UIUtil.mergeComponentsWithAnchor(keepBlankLinesOptionsGroup, blankLinesOptionsGroup);
optionsPanel.add(new JPanel(),
new GridBagConstraints(0, 2, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0,
0));
optionsPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
JScrollPane scroll = ScrollPaneFactory.createScrollPane(optionsPanel, true);
scroll.getVerticalScrollBar().setUnitIncrement(10);
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, new Insets(0, 0, 0, 0), 0, 0));
final JPanel previewPanel = createPreviewPanel();
myPanel
.add(previewPanel,
new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
installPreviewPanel(previewPanel);
addPanelToWatch(myPanel);
myIsFirstUpdate = false;
}
示例12: initCustomOptions
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
private void initCustomOptions(OptionGroup optionGroup, String groupName) {
for (Trinity<Class<? extends CustomCodeStyleSettings>, String, String> each : myCustomOptions.get(groupName)) {
doCreateOption(optionGroup, each.third, new IntOption(each.first, each.second), each.second);
}
}
示例13: createOption
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
private void createOption(OptionGroup optionGroup, String title, String fieldName) {
if (myAllOptionsAllowed || myAllowedOptions.contains(fieldName)) {
doCreateOption(optionGroup, title, new IntOption(fieldName), fieldName);
}
}
示例14: createNorthPanel
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
OptionGroup optionGroup = new OptionGroup();
myRbCurrentFile = new JRadioButton(CodeEditorBundle.message("export.to.html.file.name.radio", (myFileName != null ? myFileName : "")));
optionGroup.add(myRbCurrentFile);
myRbSelectedText = new JRadioButton(CodeEditorBundle.message("export.to.html.selected.text.radio"));
optionGroup.add(myRbSelectedText);
myRbCurrentPackage = new JRadioButton(
CodeEditorBundle.message("export.to.html.all.files.in.directory.radio", (myDirectoryName != null ? myDirectoryName : "")));
optionGroup.add(myRbCurrentPackage);
myCbIncludeSubpackages = new JCheckBox(CodeEditorBundle.message("export.to.html.include.subdirectories.checkbox"));
optionGroup.add(myCbIncludeSubpackages, true);
FileTextField field = FileChooserFactory.getInstance().createFileTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor(), myDisposable);
myTargetDirectoryField = new TextFieldWithBrowseButton(field.getField());
LabeledComponent<TextFieldWithBrowseButton> labeledComponent = assignLabel(myTargetDirectoryField, myProject);
optionGroup.add(labeledComponent);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(myRbCurrentFile);
buttonGroup.add(myRbSelectedText);
buttonGroup.add(myRbCurrentPackage);
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
myCbIncludeSubpackages.setEnabled(myRbCurrentPackage.isSelected());
}
};
myRbCurrentFile.addActionListener(actionListener);
myRbSelectedText.addActionListener(actionListener);
myRbCurrentPackage.addActionListener(actionListener);
return optionGroup.createPanel();
}
示例15: init
import com.intellij.ui.OptionGroup; //导入依赖的package包/类
@Override
protected void init() {
super.init();
JPanel optionsPanel = new JPanel(new GridBagLayout());
OptionGroup keepBlankLinesOptionsGroup = createKeepBlankLinesOptionsGroup();
OptionGroup blankLinesOptionsGroup = createBlankLinesOptionsGroup();
if (keepBlankLinesOptionsGroup != null) {
keepBlankLinesOptionsGroup.setAnchor(keepBlankLinesOptionsGroup.findAnchor());
optionsPanel.add(keepBlankLinesOptionsGroup.createPanel(),
new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0), 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,
new Insets(0, 0, 0, 0), 0, 0));
}
UIUtil.mergeComponentsWithAnchor(keepBlankLinesOptionsGroup, blankLinesOptionsGroup);
optionsPanel.add(new JPanel(),
new GridBagConstraints(0, 2, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0,
0));
JScrollPane scroll = ScrollPaneFactory.createScrollPane(optionsPanel);
scroll.setBorder(null);
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, new Insets(0, 0, 0, 5), 0, 0));
final JPanel previewPanel = createPreviewPanel();
myPanel
.add(previewPanel,
new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
installPreviewPanel(previewPanel);
addPanelToWatch(myPanel);
myIsFirstUpdate = false;
}