public PostfixTemplatesListPanel(@NotNull List<PostfixTemplate> templates) {
    ColumnInfo[] columns = generateColumns(templates);
    ListTableModel<PostfixTemplate> templatesTableModel =
        new ListTableModel<PostfixTemplate>(columns, templates, 0);
    templatesTableModel.setSortable(true);
    myTemplatesTableView = new TableView<PostfixTemplate>();
    myTemplatesTableView.setModelAndUpdateColumns(templatesTableModel);
    myTemplatesTableView.setAutoCreateRowSorter(true);
    myTemplatesTableView.setShowGrid(false);
    myTemplatesTableView.setBorder(null);

    new TableViewSpeedSearch<PostfixTemplate>(myTemplatesTableView) {
      @Override
      protected String getItemText(@NotNull PostfixTemplate template) {
        return template.getPresentableName();
      }
    };

    myPanelWithTableView =
        ToolbarDecorator.createDecorator(myTemplatesTableView)
            .setAsUsualTopToolbar()
            .disableAddAction()
            .disableRemoveAction()
            .disableUpDownActions()
            .createPanel();
  }
  public StatisticsPanel(final Project project, final TestFrameworkRunningModel model) {
    myProject = project;
    myTableModel = new StatisticsTableModel();
    myStatisticsTableView.setModelAndUpdateColumns(myTableModel);
    myFrameworkRunningModel = model;

    final Runnable gotoSuiteOrParentAction = createGotoSuiteOrParentAction();
    new DoubleClickListener() {
      @Override
      protected boolean onDoubleClick(MouseEvent e) {
        gotoSuiteOrParentAction.run();
        return true;
      }
    }.installOn(myStatisticsTableView);

    // Fire selection changed and move focus on SHIFT+ENTER
    final KeyStroke shiftEnterKey =
        KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK);
    SMRunnerUtil.registerAsAction(
        shiftEnterKey,
        "select-test-proxy-in-test-view",
        new Runnable() {
          public void run() {
            showSelectedProxyInTestsTree();
          }
        },
        myStatisticsTableView);

    // Expand selected or go to parent on ENTER
    final KeyStroke enterKey = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    SMRunnerUtil.registerAsAction(
        enterKey, "go-to-selected-suite-or-parent", gotoSuiteOrParentAction, myStatisticsTableView);
    // Contex menu in Table
    PopupHandler.installPopupHandler(
        myStatisticsTableView, IdeActions.GROUP_TESTTREE_POPUP, ActionPlaces.TESTTREE_VIEW_POPUP);
    // set this statistic tab as dataprovider for test's table view
    DataManager.registerDataProvider(myStatisticsTableView, this);
  }
Exemplo n.º 3
0
 /**
  * use {@link #setModelAndUpdateColumns(com.intellij.util.ui.ListTableModel<Item>)} instead
  *
  * @param model
  */
 @Deprecated
 public void setModel(final ListTableModel<Item> model) {
   setModelAndUpdateColumns(model);
 }
Exemplo n.º 4
0
 public TableView(final ListTableModel<Item> model) {
   super(model);
   setModelAndUpdateColumns(model);
 }