Exemple #1
0
  /**
   * Renders the component.
   *
   * @return the component
   */
  private Component getComponent() {
    ResultSet<Alert> set = new ListResultSet<Alert>(alerts, 20);
    Model model = new Model();
    table = new PagedIMTable<Alert>(model, set);

    table.getTable().setStyleName("AlertsViewerTable");
    // this style disables the selection blur style used in other tables, as it hides white text

    column = ColumnFactory.create("CellSpacing", table);

    if (alerts.size() == 1) {
      show(alerts.get(0));
    } else {
      table
          .getTable()
          .addActionListener(
              new ActionListener() {
                public void onAction(ActionEvent e) {
                  showSelected();
                }
              });
    }
    return column;
  }
Exemple #2
0
 /** Displays the selected alert. */
 private void showSelected() {
   Alert alert = table.getSelected();
   show(alert);
 }