Exemplo n.º 1
0
  /** {@inheritDoc} */
  @Override
  protected Component getComponent(ValueResult valueResult, boolean enabled) {
    final boolean canAdd = enabled && userCanPerformChangeType(ValueEventChangeType.ADD);

    final ContentPanel component = new ContentPanel();
    component.setHeadingText(getLabel());

    // Setting up the report store
    final List<?> reports = valueResult.getValuesObject();

    final ListStore<ReportReference> store = new ListStore<ReportReference>();
    if (reports != null) store.add((List<ReportReference>) reports);

    // Creating the toolbar
    if (canAdd) {
      component.setTopComponent(createToolbar(store));
    }

    // Creating the grid
    final FlexibleGrid<ReportReference> reportGrid =
        new FlexibleGrid<ReportReference>(store, null, createColumnModel(enabled));
    reportGrid.setAutoExpandColumn("name");
    reportGrid.setVisibleElementsCount(5);

    component.add(reportGrid);

    return component;
  }
Exemplo n.º 2
0
 public SectionNode(String id, ContentPanel content) {
   if (id == null || id.isEmpty()) {
     throw new IllegalArgumentException(
         "id ne doit " + "pas être nul et id ne doit pas etre vide.");
   }
   set("id", id);
   if (content != null) {
     set("content", content);
     content.setHeadingText(id);
   }
 }