|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openswing.swing.form.client.FormController
Title: OpenSwing Framework
Description: Form controller, used to listener events generated by the Form panel and to execute operations related to the form (for example loading data).
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Constructor Summary | |
FormController()
|
Method Summary | |
void |
afterDeleteData()
Callback method called after deleting SUCCESSFULLY data. |
void |
afterEditData()
Callback method called after saving SUCCESSFULLY data in EDIT mode. |
void |
afterEditData(Form form)
Callback method invoked on pressing EDIT button, after changing to edit mode. |
void |
afterInsertData()
Callback method called after saving SUCCESSFULLY data in INSERT mode. |
void |
afterInsertData(Form form)
Callback method invoked on pressing INSERT button, after changing to insert mode. |
void |
afterReloadData()
Callback method called when user has pressed on reload button. |
boolean |
beforeDeleteData(Form form)
Callback method invoked before deleting data when the form was in READONLY mode (on pressing delete button). |
boolean |
beforeEditData(Form form)
Callback method invoked on pressing EDIT button to check if edit mode is allowed. |
boolean |
beforeInsertData(Form form)
Callback method invoked on pressing INSERT button to check if insert mode is allowed. |
void |
createPersistentObject(ValueObject PersistentObject)
Callback method called by the Form panel when the Form is set to INSERT mode. |
Response |
deleteRecord(ValueObject persistentObject)
Method called by the Form panel to delete existing data. |
Response |
insertRecord(ValueObject newPersistentObject)
Method called by the Form panel to insert new data. |
Response |
loadData(java.lang.Class valueObjectClass)
This method must be overridden by the subclass to retrieve data and return the valorized value object. |
void |
loadDataCompleted(boolean error)
Callback method called when the data loading is completed. |
void |
modeChanged(int currentMode)
Callback method called when the Form mode is changed. |
Response |
updateRecord(ValueObject oldPersistentObject,
ValueObject persistentObject)
Method called by the Form panel to update existing data. |
boolean |
validateControl(java.lang.String attributeName,
java.lang.Object oldValue,
java.lang.Object newValue)
Callback method invoked each time an input control is edited: this method define if the new value if valid. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FormController()
Method Detail |
public Response insertRecord(ValueObject newPersistentObject) throws java.lang.Exception
java.lang.Exception
public Response updateRecord(ValueObject oldPersistentObject, ValueObject persistentObject) throws java.lang.Exception
oldPersistentObject
- original value object, previous to the changespersistentObject
- value object to save
java.lang.Exception
public Response deleteRecord(ValueObject persistentObject) throws java.lang.Exception
persistentObject
- value object to delete
java.lang.Exception
public void createPersistentObject(ValueObject PersistentObject) throws java.lang.Exception
java.lang.Exception
public void loadDataCompleted(boolean error)
error
- true
if an error occours during data loading, false
if data loading is successfully completedpublic void afterReloadData()
public void afterEditData()
public void afterInsertData()
public void afterDeleteData()
public Response loadData(java.lang.Class valueObjectClass)
valueObjectClass
- value object class
public void modeChanged(int currentMode)
currentMode
- current Form modepublic boolean beforeEditData(Form form)
true
allows to go to EDIT mode, false
the mode change is interruptedpublic boolean beforeInsertData(Form form)
true
allows to go to INSERT mode, false
the mode change is interruptedpublic boolean beforeDeleteData(Form form)
true
allows the deleting to continue, false
the deleting is interruptedpublic void afterEditData(Form form)
public void afterInsertData(Form form)
public boolean validateControl(java.lang.String attributeName, java.lang.Object oldValue, java.lang.Object newValue)
attributeName
- attribute name related to the input control currently editedoldValue
- old input control value (before editing)newValue
- new input control value (just edited)
true
if input control value is valid, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |