package demo18.client; import org.openswing.swing.table.client.GridController; import java.util.*; import org.openswing.swing.message.receive.java.*; import org.openswing.swing.message.send.java.FilterWhereClause; import org.openswing.swing.table.java.GridDataLocator; import org.openswing.swing.util.client.ClientUtils; /** * <p>Title: OpenSwing Framework</p> * <p>Description: Grid controller for tasks.</p> * <p>Copyright: Copyright (C) 2006 Mauro Carniel</p> * <p> </p> * @author Mauro Carniel * @version 1.0 */ public class TaskGridFrameController extends GridController { private TaskGridFrame grid = null; public TaskGridFrameController() { grid = new TaskGridFrame(this); } /** * Method invoked when the user has clicked on save button and the grid is in INSERT mode. * @param rowNumbers row indexes related to the new rows to save * @param newValueObjects list of new value objects to save * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed */ public Response insertRecords(int[] rowNumbers, ArrayList newValueObjects) throws Exception { return ClientUtils.getData("insertTasks",newValueObjects); } /** * Method invoked when the user has clicked on save button and the grid is in EDIT mode. * @param rowNumbers row indexes related to the changed rows * @param oldPersistentObjects old value objects, previous the changes * @param persistentObjects value objects relatied to the changed rows * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed */ public Response updateRecords(int[] rowNumbers,ArrayList oldPersistentObjects,ArrayList persistentObjects) throws Exception { return ClientUtils.getData("updateTasks",new ArrayList[]{oldPersistentObjects,persistentObjects}); } /** * Method invoked when the user has clicked on delete button and the grid is in READONLY mode. * @param persistentObjects value objects to delete (related to the currently selected rows) * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed */ public Response deleteRecords(ArrayList persistentObjects) throws Exception { return ClientUtils.getData("deleteTasks",persistentObjects); } }