Search in sources :

Example 1 with CheckBox

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

the class OverlyComplexBooleanExpressionInspectionBase method createOptionsPanel.

@Override
public JComponent createOptionsPanel() {
    final JPanel panel = new JPanel(new GridBagLayout());
    final CheckBox ignoreConjunctionsDisjunctionsCheckBox = new CheckBox(InspectionGadgetsBundle.message("overly.complex.boolean.expression.ignore.option"), this, "m_ignorePureConjunctionsDisjunctions");
    final NumberFormat formatter = NumberFormat.getIntegerInstance();
    formatter.setParseIntegerOnly(true);
    final JFormattedTextField termLimitTextField = prepareNumberEditor("m_limit");
    final GridBagConstraints constraints = new GridBagConstraints();
    final JLabel label = new JLabel(InspectionGadgetsBundle.message("overly.complex.boolean.expression.max.terms.option"));
    constraints.anchor = GridBagConstraints.BASELINE_LEADING;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    panel.add(label, constraints);
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 1;
    panel.add(termLimitTextField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    panel.add(ignoreConjunctionsDisjunctionsCheckBox, constraints);
    return panel;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox) NumberFormat(java.text.NumberFormat)

Example 2 with CheckBox

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

the class MethodCouplingInspection method createOptionsPanel.

@Override
public JComponent createOptionsPanel() {
    final JPanel panel = new JPanel(new GridBagLayout());
    final String configurationLabel = getConfigurationLabel();
    final JLabel label = new JLabel(configurationLabel);
    final JFormattedTextField valueField = prepareNumberEditor("m_limit");
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 0.0;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.fill = GridBagConstraints.NONE;
    panel.add(label, constraints);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.fill = GridBagConstraints.NONE;
    panel.add(valueField, constraints);
    final CheckBox arrayCheckBox = new CheckBox(InspectionGadgetsBundle.message("include.java.system.classes.option"), this, "m_includeJavaClasses");
    final CheckBox objectCheckBox = new CheckBox(InspectionGadgetsBundle.message("include.library.classes.option"), this, "m_includeLibraryClasses");
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    panel.add(arrayCheckBox, constraints);
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 2;
    constraints.weighty = 1.0;
    panel.add(objectCheckBox, constraints);
    return panel;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox)

Example 3 with CheckBox

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

the class ClassCouplingInspection method createOptionsPanel.

@Override
public JComponent createOptionsPanel() {
    final String configurationLabel = getConfigurationLabel();
    final JLabel label = new JLabel(configurationLabel);
    final JFormattedTextField valueField = prepareNumberEditor("m_limit");
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 0.0;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.insets.right = UIUtil.DEFAULT_HGAP;
    final JPanel panel = new JPanel(new GridBagLayout());
    panel.add(label, constraints);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.insets.right = 0;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.fill = GridBagConstraints.NONE;
    panel.add(valueField, constraints);
    final CheckBox arrayCheckBox = new CheckBox(InspectionGadgetsBundle.message("include.java.system.classes.option"), this, "m_includeJavaClasses");
    final CheckBox objectCheckBox = new CheckBox(InspectionGadgetsBundle.message("include.library.classes.option"), this, "m_includeLibraryClasses");
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    panel.add(arrayCheckBox, constraints);
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.weighty = 1;
    constraints.gridwidth = 2;
    panel.add(objectCheckBox, constraints);
    return panel;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox)

Example 4 with CheckBox

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

the class FieldCountInspection method createOptionsPanel.

@Override
public JComponent createOptionsPanel() {
    final String configurationLabel = getConfigurationLabel();
    final JLabel label = new JLabel(configurationLabel);
    final JFormattedTextField valueField = prepareNumberEditor("m_limit");
    final CheckBox includeCheckBox = new CheckBox(InspectionGadgetsBundle.message("field.count.inspection.include.constant.fields.in.count.checkbox"), this, "m_countConstantFields");
    final CheckBox considerCheckBox = new CheckBox(InspectionGadgetsBundle.message("field.count.inspection.static.final.fields.count.as.constant.checkbox"), this, "m_considerStaticFinalFieldsConstant");
    final CheckBox enumConstantCheckBox = new CheckBox(InspectionGadgetsBundle.message("field.count.inspection.include.enum.constants.in.count"), this, "myCountEnumConstants");
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 0.0;
    constraints.weighty = 0.0;
    constraints.insets.right = UIUtil.DEFAULT_HGAP;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.fill = GridBagConstraints.NONE;
    final JPanel panel = new JPanel(new GridBagLayout());
    panel.add(label, constraints);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.weightx = 1.0;
    constraints.insets.right = 0;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    panel.add(valueField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    panel.add(includeCheckBox, constraints);
    constraints.gridy = 2;
    panel.add(considerCheckBox, constraints);
    constraints.gridy = 3;
    constraints.weighty = 1;
    panel.add(enumConstantCheckBox, constraints);
    return panel;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox)

Example 5 with CheckBox

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

the class MultipleReturnPointsPerMethodInspection method createOptionsPanel.

@Override
public JComponent createOptionsPanel() {
    final JPanel panel = new JPanel(new GridBagLayout());
    final JLabel label = new JLabel(InspectionGadgetsBundle.message("return.point.limit.option"));
    final JFormattedTextField termLimitTextField = prepareNumberEditor("m_limit");
    final CheckBox ignoreGuardClausesCheckBox = new CheckBox(InspectionGadgetsBundle.message("ignore.guard.clauses.option"), this, "ignoreGuardClauses");
    final CheckBox ignoreEqualsMethodCheckBox = new CheckBox(InspectionGadgetsBundle.message("ignore.for.equals.methods.option"), this, "ignoreEqualsMethod");
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.anchor = GridBagConstraints.BASELINE_LEADING;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.gridx = 0;
    constraints.gridy = 0;
    panel.add(label, constraints);
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 1;
    panel.add(termLimitTextField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.weightx = 1.0;
    panel.add(ignoreGuardClausesCheckBox, constraints);
    constraints.gridy = 2;
    constraints.weighty = 1.0;
    panel.add(ignoreEqualsMethodCheckBox, constraints);
    return panel;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox)

Aggregations

CheckBox (com.intellij.util.ui.CheckBox)28 ListTable (com.intellij.codeInspection.ui.ListTable)9 ListWrappingTableModel (com.intellij.codeInspection.ui.ListWrappingTableModel)9 Nullable (org.jetbrains.annotations.Nullable)5 DocumentAdapter (com.intellij.ui.DocumentAdapter)2 NumberFormat (java.text.NumberFormat)2 DocumentEvent (javax.swing.event.DocumentEvent)2 Document (javax.swing.text.Document)2 NotNull (org.jetbrains.annotations.NotNull)2 ListEditForm (com.intellij.codeInspection.ui.ListEditForm)1 RegExFormatter (com.intellij.codeInspection.ui.RegExFormatter)1 RegExInputVerifier (com.intellij.codeInspection.ui.RegExInputVerifier)1 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)1 VerticalLayout (com.intellij.ui.components.panels.VerticalLayout)1 GridBag (com.intellij.util.ui.GridBag)1 TextField (com.siyeh.ig.ui.TextField)1 ParseException (java.text.ParseException)1 Pattern (java.util.regex.Pattern)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1