当前位置: 首页>>代码示例>>Java>>正文


Java ListTable类代码示例

本文整理汇总了Java中com.intellij.codeInspection.ui.ListTable的典型用法代码示例。如果您正苦于以下问题:Java ListTable类的具体用法?Java ListTable怎么用?Java ListTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListTable类属于com.intellij.codeInspection.ui包,在下文中一共展示了ListTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NonBooleanMethodNameMayNotStartWithQuestionInspection.java

示例2: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
  ListWrappingTableModel classTableModel =
    new ListWrappingTableModel(classNames, InspectionGadgetsBundle.message("string.format.class.column.name"));
  JPanel classChooserPanel = UiUtils
    .createAddRemoveTreeClassChooserPanel(new ListTable(classTableModel), InspectionGadgetsBundle.message("string.format.choose.class"));

  ListWrappingTableModel methodTableModel =
    new ListWrappingTableModel(methodNames, InspectionGadgetsBundle.message("string.format.class.method.name"));
  JPanel methodPanel = UiUtils.createAddRemovePanel(new ListTable(methodTableModel));

  final JPanel panel = new JPanel();
  BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);
  panel.setLayout(boxLayout);

  panel.add(classChooserPanel);
  panel.add(methodPanel);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MalformedFormatStringInspection.java

示例3: createAddRemovePanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
public static JPanel createAddRemovePanel(final ListTable table) {
  final JPanel panel = ToolbarDecorator.createDecorator(table)
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton button) {
        final ListWrappingTableModel tableModel = table.getModel();
        tableModel.addRow();
        EventQueue.invokeLater(new Runnable() {
          @Override
          public void run() {
            final int lastRowIndex = tableModel.getRowCount() - 1;
            editTableCell(table, lastRowIndex, 0);
          }
        });
      }
    }).setRemoveAction(new RemoveAction(table))
    .disableUpDownActions().createPanel();
  panel.setPreferredSize(JBUI.size(150, 100));
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:UiUtils.java

示例4: editTableCell

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
private static void editTableCell(final ListTable table, final int row, final int column) {
  final ListSelectionModel selectionModel = table.getSelectionModel();
  selectionModel.setSelectionInterval(row, row);
  EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      final ListWrappingTableModel tableModel = table.getModel();
      table.requestFocus();
      final Rectangle rectangle = table.getCellRect(row, column, true);
      table.scrollRectToVisible(rectangle);
      table.editCellAt(row, column);
      final TableCellEditor editor = table.getCellEditor();
      final Component component = editor.getTableCellEditorComponent(table, tableModel.getValueAt(row, column), true, row, column);
      component.requestFocus();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:UiUtils.java

示例5: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:BadExceptionDeclaredInspection.java

示例6: createAddRemovePanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
public static JPanel createAddRemovePanel(final ListTable table) {
  return ToolbarDecorator.createDecorator(table)
    .setAddAction(new AnActionButtonRunnable() {
      @Override
      public void run(AnActionButton button) {
        final ListWrappingTableModel tableModel = table.getModel();
        tableModel.addRow();
        EventQueue.invokeLater(new Runnable() {
          @Override
          public void run() {
            final int lastRowIndex = tableModel.getRowCount() - 1;
            final Rectangle rectangle = table.getCellRect(lastRowIndex, 0, true);
            table.scrollRectToVisible(rectangle);
            table.editCellAt(lastRowIndex, 0);
            final ListSelectionModel selectionModel = table.getSelectionModel();
            selectionModel.setSelectionInterval(lastRowIndex, lastRowIndex);
            final TableCellEditor editor = table.getCellEditor();
            final Component component = editor.getTableCellEditorComponent(table, null, true, lastRowIndex, 0);
            component.requestFocus();
          }
        });
      }
    }).setRemoveAction(new RemoveAction(table))
    .disableUpDownActions().createPanel();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:UiUtils.java

示例7: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TestMethodWithoutAssertionInspection.java

示例8: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AutoCloseableResourceInspection.java

示例9: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:IOResourceInspection.java

示例10: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LogStatementGuardedByLogConditionInspection.java

示例11: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ClassWithoutLoggerInspection.java

示例12: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
  final ListTable table = new ListTable(
    new ListWrappingTableModel(Arrays.asList(loggerFactoryClassNames, loggerFactoryMethodNames),
                               InspectionGadgetsBundle.message("logger.factory.class.name"),
                               InspectionGadgetsBundle.message("logger.factory.method.name")));
  return UiUtils.createAddRemoveTreeClassChooserPanel(table, "Choose logger factory class");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LoggerInitializedWithForeignClassInspection.java

示例13: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:BooleanMethodNameMustStartWithQuestionInspection.java

示例14: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:IgnoreResultOfCallInspection.java

示例15: createOptionsPanel

import com.intellij.codeInspection.ui.ListTable; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new GridLayout(1, 2, UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
  final ListTable table1 = new ListTable(new ListWrappingTableModel(queryNames, InspectionGadgetsBundle.message("query.column.name")));
  final JPanel tablePanel1 = UiUtils.createAddRemovePanel(table1);

  final ListTable table2 = new ListTable(new ListWrappingTableModel(updateNames, InspectionGadgetsBundle.message("update.column.name")));
  final JPanel tablePanel2 = UiUtils.createAddRemovePanel(table2);

  panel.add(tablePanel1);
  panel.add(tablePanel2);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:MismatchedCollectionQueryUpdateInspection.java


注:本文中的com.intellij.codeInspection.ui.ListTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。