/**
   * Lays out child components in a tab model.
   *
   * @param object the parent object
   * @param properties the properties
   * @param model the tab model
   * @param context the layout context
   * @param shortcuts if <tt>true</tt> include short cuts
   */
  @Override
  protected void doTabLayout(
      IMObject object,
      List<Property> properties,
      IMObjectTabPaneModel model,
      LayoutContext context,
      boolean shortcuts) {
    super.doTabLayout(object, properties, model, context, shortcuts);
    Browser<Act> appointments = getAppointments((Party) object, context);
    Component inset = ColumnFactory.create(Styles.INSET, appointments.getComponent());

    String label = Messages.get("customer.info.appointments");
    if (shortcuts && model.size() < 10) {
      label = getShortcut(label, model.size() + 1);
    }
    model.addTab(label, inset);
  }
Example #2
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;
  }
Example #3
0
 /** Lays out the component prior to display. */
 @Override
 protected void doLayout() {
   Column column = ColumnFactory.create("Inset", getComponent());
   getLayout().add(column);
 }