예제 #1
0
  // How about using the Container's panel?? TODO
  public WF_Table(
      String id,
      boolean isVisible,
      WF_Context ctx,
      String namePrefix,
      String variatorColumn,
      View tableV) {
    super(id, isVisible, ctx, tableV);
    this.tableView = (TableLayout) tableV.findViewById(R.id.table);
    ;
    myContext = ctx;
    gs = GlobalState.getInstance();
    o = gs.getLogger();
    al = gs.getVariableConfiguration();
    myVariator = variatorColumn;
    // myTable = new GridView(ctx.getContext());

    // Create rows.
    inflater = (LayoutInflater) ctx.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    // Add the header.
    headerRow =
        new WF_Table_Row(
            tableView,
            ColHeadId,
            inflater.inflate(R.layout.header_table_row, null),
            myContext,
            true);
    // Add a first empty cell
    headerRow.addEmptyCell(id);
    tableView.addView(headerRow.getWidget());

    varNamePrefix = namePrefix;

    allInstances = gs.getDb().preFetchValues(myContext.getKeyHash(), namePrefix, myVariator);
    Log.d(
        "nils",
        "in update entry fields. AllInstances contain "
            + allInstances.size()
            + ": "
            + allInstances.toString());
    tableView.setStretchAllColumns(true);
    addSorter(new WF_Alphanumeric_Sorter());
  }
예제 #2
0
 @Override
 protected void prepareDraw() {
   tableView.removeAllViews();
   tableView.addView(headerRow.getWidget());
 }