コード例 #1
0
  private RowProvider buildProviderForRowLayout(KeyValueList properties) {

    if (!properties.contains("key")) {
      throw new RuntimeException(
          "row-layout expects a key for the data model array providing data for each row");
    }

    final String rowLayout = properties.getValue("row-layout");

    final String key = properties.getValue("key");
    return new RowProviderRowLayout(key, rowLayout);
  }
コード例 #2
0
  private RowProvider buildProviderForTableLayout(KeyValueList properties) {

    final TableLayout tableLayout =
        GlobalState.fluidApp.getViewManager().getTableLayout(properties.getValue("table-layout"));

    RowProvider provider = new RowProviderTableLayout(tableLayout);
    return provider;
  }
コード例 #3
0
  public ViewBehaviorTable getViewBehaviorTable(KeyValueList properties) {

    RowProvider provider = null;

    if (properties.contains("row-layout") && properties.contains("table-layout")) {
      throw new RuntimeException("May not use row-layout and table-layout at the same time.");
    }

    if (properties.contains("row-layout")) {
      provider = buildProviderForRowLayout(properties);
    } else if (properties.contains("table-layout")) {
      provider = buildProviderForTableLayout(properties);
    } else {
      throw new RuntimeException("Must use row-layout or table-layout");
    }

    return new ViewBehaviorTable(properties, provider);
  }