예제 #1
0
 /** Reset the columns to initial sizes (if set) */
 public synchronized void reset() {
   if (desiredColSizes != null) {
     createDefaultColumnsFromModel();
     TableFormat.resizeCols(this, desiredColSizes, fixedCols);
   } else {
     createDefaultColumnsFromModel();
   }
   if (persistanceHandler != null) {
     persistanceHandler.restore();
     persistanceHandler.set();
   }
 }
예제 #2
0
  /**
   * Sets the data model for this table to newModel and registers with it for listener notifications
   * from the new data model. Additionally takes care of the registered {@link
   * TableViewPersistenceHandler}.
   *
   * @param model
   */
  @Override
  public void setModel(TableModel model) {
    synchronized (this) {
      super.setModel(model);
      Log.Debug(this, "done set model");

      if (persistanceHandler != null) {
        persistanceHandler.restore();
        persistanceHandler.set();
      }
    }
  }
예제 #3
0
 /**
  * Sets the data model for this table to newModel and registers with it for listener notifications
  * from the new data model. Additionally takes care of the registered {@link
  * TableViewPersistenceHandler}.
  *
  * @param model
  * @param fieldCount
  * @param fields
  */
 public synchronized void setModel(List<DatabaseObject> model, int fieldCount, String fields) {
   Object[][] data = new Object[model.size()][];
   for (int i = 0; i < model.size(); i++) {
     DatabaseObject databaseObject = model.get(i);
     data[i] = databaseObject.toResolvedArray(fieldCount, fields);
   }
   MPTableModel m = new MPTableModel(data);
   setModel(m);
   if (persistanceHandler != null) {
     persistanceHandler.restore();
     persistanceHandler.set();
   }
 }
예제 #4
0
 /** @param persistanceHandler the persistanceHandler to set */
 public void setPersistanceHandler(TableViewPersistenceHandler persistanceHandler) {
   this.persistanceHandler = persistanceHandler;
   if (persistanceHandler != null) {
     persistanceHandler.set();
   }
 }