Java 类com.intellij.util.ui.CheckBox 实例源码

项目:intellij-ce-playground    文件:EmptyClassInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  constraints.gridy++;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  final CheckBox checkBox1 = new CheckBox(InspectionGadgetsBundle.message("empty.class.ignore.parameterization.option"),
                                                 this, "ignoreClassWithParameterization");
  panel.add(checkBox1, constraints);
  constraints.gridy++;
  final CheckBox checkBox2 = new CheckBox("Ignore subclasses of java.lang.Throwable", this, "ignoreThrowables");
  panel.add(checkBox2, constraints);
  return panel;
}
项目:intellij-ce-playground    文件:InstanceVariableUninitializedUseInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());

  final JPanel annotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    annotationNames, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("primitive.fields.ignore.option"), this, "m_ignorePrimitives");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsPanel, constraints);

  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);

  return panel;
}
项目:intellij-ce-playground    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:PublicMethodNotExposedInInterfaceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
      ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weighty = 1.0;
  constraints.weightx = 1.0;
  constraints.anchor = GridBagConstraints.CENTER;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "public.method.not.in.interface.option"), this, "onlyWarnIfContainingClassImplementsAnInterface");
  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);
  return panel;
}
项目:intellij-ce-playground    文件:BadExceptionDeclaredInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());
  final ListTable table =
    new ListTable(new ListWrappingTableModel(exceptions, InspectionGadgetsBundle.message("exception.class.column.name")));
  final JPanel tablePanel =
    UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.exception.class"), "java.lang.Throwable");
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(tablePanel, constraints);


  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.exceptions.declared.on.library.override.option"), this,
                 "ignoreLibraryOverrides");
  constraints.weighty = 0.0;
  constraints.gridy = 1;
  panel.add(checkBox2, constraints);
  return panel;
}
项目:intellij-ce-playground    文件:StaticImportInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  final JPanel chooserList =
    UiUtils.createTreeClassChooserList(allowedClasses, "Statically importable Classes", "Choose statically importable class");
  panel.add(chooserList, constraints);

  constraints.gridy = 1;
  constraints.weighty = 0.0;
  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.single.field.static.imports.option"), this, "ignoreSingleFieldImports");
  panel.add(checkBox1, constraints);

  constraints.gridy = 2;
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.single.method.static.imports.option"), this, "ignoreSingeMethodImports");
  panel.add(checkBox2, constraints);

  return panel;
}
项目:intellij-ce-playground    文件:ConstructorCountInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JLabel label = new JLabel(getConfigurationLabel());
  final JFormattedTextField valueField = prepareNumberEditor("m_limit");
  final CheckBox includeCheckBox =
    new CheckBox(InspectionGadgetsBundle.message("too.many.constructors.ignore.deprecated.option"), this, "ignoreDeprecatedConstructors");

  final GridBag bag = new GridBag();
  bag.setDefaultInsets(0, 0, 0, UIUtil.DEFAULT_HGAP);
  bag.setDefaultAnchor(GridBagConstraints.WEST);
  final JPanel panel = new JPanel(new GridBagLayout());
  panel.add(label, bag.nextLine().next());
  panel.add(valueField, bag.next().weightx(1.0));
  panel.add(includeCheckBox, bag.nextLine().next().coverLine().weighty(1.0).anchor(GridBagConstraints.NORTHWEST));
  return panel;
}
项目:tools-idea    文件:EmptyClassInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  constraints.gridy++;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  final CheckBox checkBox1 = new CheckBox(InspectionGadgetsBundle.message("empty.class.ignore.parameterization.option"),
                                                 this, "ignoreClassWithParameterization");
  panel.add(checkBox1, constraints);
  constraints.gridy++;
  final CheckBox checkBox2 = new CheckBox("Ignore subclasses of java.lang.Throwable", this, "ignoreThrowables");
  panel.add(checkBox2, constraints);
  return panel;
}
项目:tools-idea    文件:InstanceVariableUninitializedUseInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());

  final JPanel annotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    annotationNames, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("primitive.fields.ignore.option"), this, "m_ignorePrimitives");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsPanel, constraints);

  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);

  return panel;
}
项目:tools-idea    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:tools-idea    文件:PublicMethodNotExposedInInterfaceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
      ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weighty = 1.0;
  constraints.weightx = 1.0;
  constraints.anchor = GridBagConstraints.CENTER;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "public.method.not.in.interface.option"), this, "onlyWarnIfContainingClassImplementsAnInterface");
  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);
  return panel;
}
项目:tools-idea    文件:ConstructorCountInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JLabel label = new JLabel(getConfigurationLabel());
  final JFormattedTextField valueField = prepareNumberEditor("m_limit");
  final CheckBox includeCheckBox =
    new CheckBox(InspectionGadgetsBundle.message("too.many.constructors.ignore.deprecated.option"), this, "ignoreDeprecatedConstructors");

  final GridBag bag = new GridBag();
  bag.setDefaultInsets(0, 0, 0, UIUtil.DEFAULT_HGAP);
  bag.setDefaultAnchor(GridBagConstraints.WEST);
  final JPanel panel = new JPanel(new GridBagLayout());
  panel.add(label, bag.nextLine().next());
  panel.add(valueField, bag.next().weightx(1.0));
  panel.add(includeCheckBox, bag.nextLine().next().coverLine().weighty(1.0).anchor(GridBagConstraints.NORTHWEST));
  return panel;
}
项目:consulo-java    文件:EmptyClassInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  constraints.gridy++;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  final CheckBox checkBox1 = new CheckBox(InspectionGadgetsBundle.message("empty.class.ignore.parameterization.option"),
                                                 this, "ignoreClassWithParameterization");
  panel.add(checkBox1, constraints);
  constraints.gridy++;
  final CheckBox checkBox2 = new CheckBox("Ignore subclasses of java.lang.Throwable", this, "ignoreThrowables");
  panel.add(checkBox2, constraints);
  return panel;
}
项目:consulo-java    文件:InstanceVariableUninitializedUseInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());

  final JPanel annotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    annotationNames, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("primitive.fields.ignore.option"), this, "m_ignorePrimitives");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsPanel, constraints);

  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);

  return panel;
}
项目:consulo-java    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:consulo-java    文件:ConstructorCountInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JLabel label = new JLabel(getConfigurationLabel());
  final JFormattedTextField valueField = prepareNumberEditor("m_limit");
  final CheckBox includeCheckBox =
    new CheckBox(InspectionGadgetsBundle.message("too.many.constructors.ignore.deprecated.option"), this, "ignoreDeprecatedConstructors");

  final GridBag bag = new GridBag();
  bag.setDefaultInsets(0, 0, 0, UIUtil.DEFAULT_HGAP);
  bag.setDefaultAnchor(GridBagConstraints.WEST);
  final JPanel panel = new JPanel(new GridBagLayout());
  panel.add(label, bag.nextLine().next());
  panel.add(valueField, bag.next().weightx(1.0));
  panel.add(includeCheckBox, bag.nextLine().next().coverLine().weighty(1.0).anchor(GridBagConstraints.NORTHWEST));
  return panel;
}
项目:consulo-java    文件:PublicMethodNotExposedInInterfaceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
      ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weighty = 1.0;
  constraints.weightx = 1.0;
  constraints.anchor = GridBagConstraints.CENTER;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(annotationsListControl, constraints);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "public.method.not.in.interface.option"), this, "onlyWarnIfContainingClassImplementsAnInterface");
  constraints.gridy = 1;
  constraints.weighty = 0.0;
  constraints.anchor = GridBagConstraints.WEST;
  constraints.fill = GridBagConstraints.HORIZONTAL;
  panel.add(checkBox, constraints);
  return panel;
}
项目:consulo-java    文件:StaticImportInspection.java   
@Override
public JComponent createOptionsPanel()
{
    final JComponent panel = new JPanel(new GridBagLayout());
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    constraints.fill = GridBagConstraints.BOTH;
    final JPanel chooserList = UiUtils.createTreeClassChooserList(allowedClasses, "Statically importable Classes", "Choose statically importable class");
    panel.add(chooserList, constraints);

    constraints.gridy = 1;
    constraints.weighty = 0.0;
    final CheckBox checkBox1 = new CheckBox(InspectionGadgetsBundle.message("ignore.single.field.static.imports.option"), this, "ignoreSingleFieldImports");
    panel.add(checkBox1, constraints);

    constraints.gridy = 2;
    final CheckBox checkBox2 = new CheckBox(InspectionGadgetsBundle.message("ignore.single.method.static.imports.option"), this, "ignoreSingeMethodImports");
    panel.add(checkBox2, constraints);

    return panel;
}
项目:intellij-ce-playground    文件:PyPep8NamingInspection.java   
@Nullable
@Override
public JComponent createOptionsPanel() {
  final JPanel rootPanel = new JPanel(new BorderLayout());
  rootPanel.add(new CheckBox("Ignore overridden functions", this, "ignoreOverriddenFunctions"), BorderLayout.NORTH);
  rootPanel.add(new ListEditForm("Excluded base classes", ignoredBaseClasses).getContentPanel(), BorderLayout.CENTER);
  return rootPanel;
}
项目:intellij-ce-playground    文件:SerializableInspectionUtil.java   
@NotNull
public static JComponent createOptions(@NotNull SerializableInspectionBase inspection) {
  final JComponent panel = new JPanel(new GridBagLayout());

  final JPanel chooserList = UiUtils.createTreeClassChooserList(
    inspection.superClassList, InspectionGadgetsBundle.message("ignore.classes.in.hierarchy.column.name"),
    InspectionGadgetsBundle.message("choose.super.class.to.ignore"));
  UiUtils.setComponentSize(chooserList, 7, 25);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "ignore.anonymous.inner.classes"), inspection, "ignoreAnonymousInnerClasses");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;

  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(chooserList, constraints);

  final JComponent[] additionalOptions = inspection.createAdditionalOptions();
  for (JComponent additionalOption : additionalOptions) {
    constraints.gridy++;
    if (additionalOption instanceof JPanel) {
      constraints.fill = GridBagConstraints.BOTH;
      constraints.weighty = 1.0;
    }
    else {
      constraints.fill = GridBagConstraints.HORIZONTAL;
      constraints.weighty = 0.0;
    }
    panel.add(additionalOption, constraints);
  }

  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.gridy++;
  constraints.weighty = 0.0;
  panel.add(checkBox, constraints);
  return panel;
}
项目:intellij-ce-playground    文件:RefusedBequestInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(annotations, null);
  final JCheckBox checkBox1 = new CheckBox("Only report when super method is annotated by:", this, "onlyReportWhenAnnotated");
  final CheckBox checkBox2 = new CheckBox(InspectionGadgetsBundle.message("refused.bequest.ignore.empty.super.methods.option"),
                                          this, "ignoreEmptySuperMethods");

  panel.add(checkBox1, BorderLayout.NORTH);
  panel.add(annotationsListControl, BorderLayout.CENTER);
  panel.add(checkBox2, BorderLayout.SOUTH);

  return panel;
}
项目:intellij-ce-playground    文件:TestMethodWithoutAssertionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(
    new ListWrappingTableModel(Arrays.asList(classNames, methodNamePatterns), "Assertion class name",
                               InspectionGadgetsBundle.message("method.name.pattern")));
  final JPanel tablePanel = UiUtils.createAddRemoveTreeClassChooserPanel(table, "Choose assertion class");
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("assert.keyword.is.considered.an.assertion"), this, "assertKeywordIsAssertion");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:UtilityClassWithoutPrivateConstructorInspection.java   
@Override
@Nullable
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JPanel annotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  panel.add(annotationsPanel, BorderLayout.CENTER);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("utility.class.without.private.constructor.option"),
                                         this, "ignoreClassesWithOnlyMain");
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:AutoCloseableResourceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new BorderLayout());
  final ListTable table =
    new ListTable(new ListWrappingTableModel(ignoredTypes, InspectionGadgetsBundle.message("ignored.autocloseable.types.column.label")));
  final JPanel tablePanel =
    UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.autocloseable.type.to.ignore.title"),
                                                 "java.lang.AutoCloseable");
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("auto.closeable.resource.returned.option"), this, "ignoreFromMethodCall");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:IOResourceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new BorderLayout());
  final ListTable table =
    new ListTable(new ListWrappingTableModel(ignoredTypes, InspectionGadgetsBundle.message("ignored.io.resource.types")));
  JPanel tablePanel =
    UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.io.resource.type.to.ignore"), IO_TYPES);
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("allow.resource.to.be.opened.inside.a.try.block"), this, "insideTryAllowed");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:LogStatementGuardedByLogConditionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JLabel classNameLabel = new JLabel(InspectionGadgetsBundle.message("logger.name.option"));
  classNameLabel.setHorizontalAlignment(SwingConstants.TRAILING);
  final TextField loggerClassNameField = new TextField(this, "loggerClassName");
  final ListTable table = new ListTable(new ListWrappingTableModel(Arrays.asList(logMethodNameList, logConditionMethodNameList),
                                                                   InspectionGadgetsBundle.message("log.method.name"),
                                                                   InspectionGadgetsBundle.message("log.condition.text")));
  panel.add(UiUtils.createAddRemovePanel(table), BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addLabeledComponent(classNameLabel, loggerClassNameField).getPanel(), BorderLayout.NORTH);
  panel.add(new CheckBox(InspectionGadgetsBundle.message("log.statement.guarded.by.log.condition.flag.all.unguarded.option"),
                         this, "flagAllUnguarded"), BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:ClassWithoutLoggerInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(loggerNames, InspectionGadgetsBundle.message("logger.class.name")));
  final JPanel tablePanel = UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.logger.class"));
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("super.class.logger.option"), this, "ignoreSuperLoggers");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:PublicFieldInspection.java   
@Override
@Nullable
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JPanel annotationsListControl = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  panel.add(annotationsListControl, BorderLayout.CENTER);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "public.field.ignore.enum.type.fields.option"), this, "ignoreEnums");
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:BooleanMethodNameMustStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(tablePanel, constraints);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  constraints.gridy = 1;
  constraints.weighty = 0.0;
  panel.add(checkBox1, constraints);

  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.boolean.methods.in.an.interface.option"), this, "ignoreInAnnotationInterface");
  constraints.gridy = 2;
  panel.add(checkBox2, constraints);

  final CheckBox checkBox3 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");
  constraints.gridy = 3;
  panel.add(checkBox3, constraints);
  return panel;
}
项目:intellij-ce-playground    文件:LocalVariableNamingConventionInspection.java   
@Override
public JComponent[] createExtraOptions() {
  return new JComponent[] {
    new CheckBox(InspectionGadgetsBundle.message("local.variable.naming.convention.ignore.option"), this, "m_ignoreForLoopParameters"),
    new CheckBox(InspectionGadgetsBundle.message("local.variable.naming.convention.ignore.catch.option"), this, "m_ignoreCatchParameters")
  };
}
项目:intellij-ce-playground    文件:IgnoreResultOfCallInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(
    Arrays.asList(classNames, methodNamePatterns), InspectionGadgetsBundle.message("result.of.method.call.ignored.class.column.title"),
    InspectionGadgetsBundle.message("result.of.method.call.ignored.method.column.title")));
  final JPanel tablePanel = UiUtils.createAddRemoveTreeClassChooserPanel(table, "Choose class");
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("result.of.method.call.ignored.non.library.option"), this, "m_reportAllNonLibraryCalls");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:SizeReplaceableByIsEmptyInspection.java   
@Override
@Nullable
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new BorderLayout());
  final ListTable table =
    new ListTable(new ListWrappingTableModel(ignoredTypes, InspectionGadgetsBundle.message("ignored.classes.table")));
  JPanel tablePanel =
    UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.class.type.to.ignore"));
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "size.replaceable.by.isempty.negation.ignore.option"), this, "ignoreNegations");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:MethodCountInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());
  final Component label = new JLabel(InspectionGadgetsBundle.message("method.count.limit.option"));
  final JFormattedTextField valueField = prepareNumberEditor("m_limit");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.insets.right = UIUtil.DEFAULT_HGAP;
  constraints.anchor = GridBagConstraints.WEST;
  panel.add(label, constraints);
  constraints.gridx = 1;
  constraints.weightx = 1.0;
  constraints.insets.right = 0;
  panel.add(valueField, constraints);

  final CheckBox gettersSettersCheckBox = new CheckBox(InspectionGadgetsBundle.message("method.count.ignore.getters.setters.option"),
    this, "ignoreGettersAndSetters");

  constraints.gridx = 0;
  constraints.gridy = 1;
  constraints.gridwidth = 2;
  constraints.anchor = GridBagConstraints.WEST;
  panel.add(gettersSettersCheckBox, constraints);

  final CheckBox overridingMethodCheckBox =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "ignoreOverridingMethods");

  constraints.weighty = 1.0;
  constraints.gridy = 2;
  constraints.anchor = GridBagConstraints.NORTHWEST;
  panel.add(overridingMethodCheckBox, constraints);

  return panel;
}
项目:intellij-ce-playground    文件:OverlyComplexBooleanExpressionInspectionBase.java   
@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;
}
项目:intellij-ce-playground    文件:MultipleReturnPointsPerMethodInspection.java   
@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;
}
项目:tools-idea    文件:SerializableInspection.java   
@Override
public final JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new GridBagLayout());

  final JPanel chooserList = UiUtils.createTreeClassChooserList(
    superClassList, InspectionGadgetsBundle.message("ignore.classes.in.hierarchy.column.name"),
    InspectionGadgetsBundle.message("choose.super.class.to.ignore"));
  UiUtils.setComponentSize(chooserList, 7, 25);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message(
    "ignore.anonymous.inner.classes"), this, "ignoreAnonymousInnerClasses");

  final GridBagConstraints constraints = new GridBagConstraints();
  constraints.gridx = 0;
  constraints.gridy = 0;

  constraints.weightx = 1.0;
  constraints.weighty = 1.0;
  constraints.fill = GridBagConstraints.BOTH;
  panel.add(chooserList, constraints);

  constraints.fill = GridBagConstraints.BOTH;
  final JComponent[] additionalOptions = createAdditionalOptions();
  for (JComponent additionalOption : additionalOptions) {
    constraints.gridy++;
    panel.add(additionalOption, constraints);
  }

  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.gridy++;
  constraints.weighty = 0.0;
  panel.add(checkBox, constraints);
  return panel;
}
项目:tools-idea    文件:TestMethodWithoutAssertionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(
    new ListWrappingTableModel(Arrays.asList(classNames, methodNamePatterns), InspectionGadgetsBundle.message("class.name"),
                               InspectionGadgetsBundle.message("method.name.pattern")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("assert.keyword.is.considered.an.assertion"), this, "assertKeywordIsAssertion");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:tools-idea    文件:UtilityClassWithoutPrivateConstructorInspection.java   
@Override
@Nullable
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JPanel annotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(
    ignorableAnnotations, InspectionGadgetsBundle.message("ignore.if.annotated.by"));
  panel.add(annotationsPanel, BorderLayout.CENTER);
  final CheckBox checkBox = new CheckBox(InspectionGadgetsBundle.message("utility.class.without.private.constructor.option"),
                                         this, "ignoreClassesWithOnlyMain");
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:tools-idea    文件:IOResourceInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JComponent panel = new JPanel(new BorderLayout());
  final ListTable table =
    new ListTable(new ListWrappingTableModel(ignoredTypes, InspectionGadgetsBundle.message("ignored.io.resource.types")));
  JPanel tablePanel =
    UiUtils.createAddRemoveTreeClassChooserPanel(table, InspectionGadgetsBundle.message("choose.io.resource.type.to.ignore"), IO_TYPES);
  final CheckBox checkBox =
    new CheckBox(InspectionGadgetsBundle.message("allow.resource.to.be.opened.inside.a.try.block"), this, "insideTryAllowed");
  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(checkBox, BorderLayout.SOUTH);
  return panel;
}
项目:tools-idea    文件:LogStatementGuardedByLogConditionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JLabel classNameLabel = new JLabel(InspectionGadgetsBundle.message("logger.name.option"));
  classNameLabel.setHorizontalAlignment(SwingConstants.TRAILING);
  final TextField loggerClassNameField = new TextField(this, "loggerClassName");
  final ListTable table = new ListTable(new ListWrappingTableModel(Arrays.asList(logMethodNameList, logConditionMethodNameList),
                                                                   InspectionGadgetsBundle.message("log.method.name"),
                                                                   InspectionGadgetsBundle.message("log.condition.text")));
  panel.add(UiUtils.createAddRemovePanel(table), BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addLabeledComponent(classNameLabel, loggerClassNameField).getPanel(), BorderLayout.NORTH);
  panel.add(new CheckBox(InspectionGadgetsBundle.message("log.statement.guarded.by.log.condition.flag.all.unguarded.option"),
                         this, "flagAllUnguarded"), BorderLayout.SOUTH);
  return panel;
}