Search in sources :

Example 6 with OptionGroup

use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.

the class ExportToHTMLDialog method createNorthPanel.

@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();
}
Also used : OptionGroup(com.intellij.ui.OptionGroup) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) FileTextField(com.intellij.openapi.fileChooser.FileTextField)

Example 7 with OptionGroup

use of com.intellij.ui.OptionGroup in project intellij-community by JetBrains.

the class CodeStyleBlankLinesPanel method createOptionsGroup.

@Nullable
private OptionGroup createOptionsGroup(@NotNull String groupName, @NotNull List<CodeStyleSettingPresentation> settings) {
    OptionGroup optionGroup = new OptionGroup(groupName);
    for (CodeStyleSettingPresentation setting : settings) {
        createOption(optionGroup, setting.getUiName(), setting.getFieldName());
    }
    initCustomOptions(optionGroup, groupName);
    if (optionGroup.getComponents().length == 0)
        return null;
    return optionGroup;
}
Also used : OptionGroup(com.intellij.ui.OptionGroup) CodeStyleSettingPresentation(com.intellij.psi.codeStyle.presentation.CodeStyleSettingPresentation) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

OptionGroup (com.intellij.ui.OptionGroup)7 FileTextField (com.intellij.openapi.fileChooser.FileTextField)1 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 CodeStyleSettingPresentation (com.intellij.psi.codeStyle.presentation.CodeStyleSettingPresentation)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1