Exemplo n.º 1
0
  /**
   * @param conn
   * @param tableId
   * @param colName
   * @param value
   * @param isEditable
   */
  public DataObjTableModel(
      final Connection conn,
      final int tableId,
      final String colName,
      final Object value,
      final boolean isEditable) {
    super();

    this.conn = conn;
    this.isEditable = isEditable;
    this.colName = colName;
    this.searchValue = value;
    this.tableInfo = DBTableIdMgr.getInstance().getInfoById(tableId);
  }
Exemplo n.º 2
0
  public ReviewLogTblModel() {
    super();
    Random rand = new Random(System.currentTimeMillis());

    // initialize
    int num = rand.nextInt(15) + 15;
    for (int i = 0; i < num; i++) {
      int clsIndex = rand.nextInt(dataCls.length);
      Class<?> cls = dataCls[clsIndex];
      String desc;
      Icon icon;
      if (cls == SGRTask.class) {
        icon = IconManager.getIcon("SGR", IconManager.STD_ICON_SIZE.Std20);
        desc = "SGR";
      } else {
        icon = IconManager.getIcon(cls.getSimpleName(), IconManager.STD_ICON_SIZE.Std20);
        DBTableInfo ti = DBTableIdMgr.getInstance().getByShortClassName(cls.getSimpleName());
        desc = (ti != null ? ti.getTitle() : "X");
      }

      boolean isNewData = rand.nextDouble() > 0.5;
      boolean isBatch = rand.nextDouble() > 0.5;

      String[] actionArray = actionData[clsIndex];
      int actionIndex = rand.nextInt(actionArray.length);
      String action = actionArray[actionIndex];
      String source = instTitles[rand.nextInt(instTitles.length)];

      int numRecords = 0;
      if (isBatch) {
        numRecords = rand.nextInt(233) + 177;

      } else if (clsIndex == 6 && actionIndex == 2) {
        numRecords = rand.nextInt(5) + 1;
      }

      NotiLogInfo nli = new NotiLogInfo(icon, desc, isNewData, action, isBatch, numRecords, source);
      data.add(nli);
    }
  }
Exemplo n.º 3
0
  /**
   * @param conn
   * @param tableId
   * @param items
   * @param hasDataList
   * @param sameValues
   * @param mapInx
   * @param indexHash
   */
  public DataObjTableModel(
      final Connection conn,
      final int tableId,
      final ArrayList<DBInfoBase> items,
      final ArrayList<Boolean> hasDataList,
      final ArrayList<Boolean> sameValues,
      final int[] mapInx,
      final HashMap<Integer, Integer> indexHash) {
    super();

    this.conn = conn;
    this.items = items;
    this.hasDataList = hasDataList;
    this.sameValues = sameValues;
    this.mapInx = mapInx;
    this.indexHash = indexHash;
    this.isEditable = true;

    this.tableInfo = DBTableIdMgr.getInstance().getInfoById(tableId);

    this.values = new Vector<Object[]>();
    this.values.add(new Object[items != null ? items.size() : 1]);
  }