|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjform.AbstractPObjForm
public abstract class AbstractPObjForm
Abstract base class for rendering forms based on meta-data from the
PObject library.
FormDecl,
Messages| Field Summary | |
|---|---|
static java.lang.String |
ERROR_INVALID_VALUE
Message key that specifies that the value is invalid. |
static java.lang.String |
ERROR_MANDATORY
Message key that specifies that the value is mandatory. |
| Constructor Summary | |
|---|---|
AbstractPObjForm(Container container)
Creates a new PObject-enhanced form. |
|
| Method Summary | |
|---|---|
void |
addErrorMessage(java.lang.String messageId,
java.lang.Object... params)
Adds a success message to the set of global messages. |
void |
addInvalidValueMessage(java.lang.String property,
java.lang.Object... params)
Adds an error message for the specified property that the value invalid. |
void |
addMandatoryMessage(java.lang.String property)
Adds an error message for the specified property that the value is mandatory. |
void |
addMessage(java.lang.String property,
Message msg)
Add a message to the set of messages for the specified property. |
void |
addSuccessMessage(java.lang.String messageId,
java.lang.Object... params)
Adds a success message to the set of global messages. |
void |
clearMessage(java.lang.String property,
java.lang.String msgKey)
Removes a specific message for the given property. |
void |
clearMessages()
Clear all messages recorded by this object. |
void |
dumpMessages(java.io.PrintStream ps,
java.util.ResourceBundle bundle)
|
static java.lang.Integer[] |
extractIndexes(java.lang.String property)
|
Container |
getContainer()
Returns the database connection which the form uses. |
static java.lang.String |
getElementLabelKey(FormElement element)
Returns the message resource key for the given element. |
java.util.List<FormElement> |
getElements()
|
int |
getMessageCount()
Return the number of messages recorded for all properties (including global messages). |
int |
getMessageCount(java.lang.String property)
Return the number of messages associated with the specified property. |
java.util.Iterator<java.lang.String> |
getMessageProperties()
Return the set of property names for which at least one message has been recorded. |
Messages |
getMessages()
|
java.util.Iterator<Message> |
getMessages(java.lang.String property)
Return the set of messages related to a specific property. |
boolean |
hasChanged()
Tests whether any element in the form has been changed. |
boolean |
hasChanged(FormEntry entry)
Tests whether the value of the element for the given entry has changed. |
boolean |
hasChanged(java.lang.String entryName)
Tests whether the value of the element with the given name has changed. |
boolean |
hasMessages()
Return true if there are no messages recorded in this object,
or false otherwise. |
void |
populateForm(Record record,
FormEntry[] entries)
Populates the specified form entries with the data from the record. |
void |
populateForm(Record record,
FormEntry[] entries,
boolean setCurrentAsInitial)
Populates the specified form entries with the data from the record. |
void |
populateObject(FormEntry[] entries,
Record record)
Populates the record with the data from the form elements of the corresponding form entries. |
void |
populateObject(FormEntry[] entries,
Record record,
boolean transferUnchangedValues)
Populates the record with the data from the form elements of the corresponding form entries. |
void |
setContainer(Container container)
|
void |
setCurrentAsInitialState()
|
void |
validate()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.mguennewig.pobjform.PObjForm |
|---|
createFormElement, getElement, getFormDecl |
| Field Detail |
|---|
public static final java.lang.String ERROR_INVALID_VALUE
public static final java.lang.String ERROR_MANDATORY
| Constructor Detail |
|---|
public AbstractPObjForm(Container container)
container - The database connection, which should be used.| Method Detail |
|---|
public final void addMessage(java.lang.String property,
Message msg)
addMessage in interface PObjForm
public final void addInvalidValueMessage(java.lang.String property,
java.lang.Object... params)
addInvalidValueMessage in interface PObjFormPObjForm.addMessage(String,Message)public final void addMandatoryMessage(java.lang.String property)
addMandatoryMessage in interface PObjFormPObjForm.addMessage(String,Message)
public final void addErrorMessage(java.lang.String messageId,
java.lang.Object... params)
addErrorMessage in interface PObjForm
public final void addSuccessMessage(java.lang.String messageId,
java.lang.Object... params)
addSuccessMessage in interface PObjFormpublic final void clearMessages()
clearMessages in interface PObjForm
public final void clearMessage(java.lang.String property,
java.lang.String msgKey)
clearMessage in interface PObjFormpublic final int getMessageCount()
getMessageCount in interface PObjFormpublic final int getMessageCount(java.lang.String property)
getMessageCount in interface PObjFormpublic final java.util.Iterator<java.lang.String> getMessageProperties()
getMessageProperties in interface PObjFormpublic final Messages getMessages()
getMessages in interface PObjFormpublic final java.util.Iterator<Message> getMessages(java.lang.String property)
getMessages in interface PObjFormpublic final boolean hasMessages()
true if there are no messages recorded in this object,
or false otherwise.
hasMessages in interface PObjFormpublic final java.util.List<FormElement> getElements()
getElements in interface PObjFormpublic final Container getContainer()
getContainer in interface PObjFormpublic final void setContainer(Container container)
setContainer in interface PObjFormpublic boolean hasChanged()
hasChanged in interface PObjFormpublic final boolean hasChanged(java.lang.String entryName)
hasChanged in interface PObjFormpublic final boolean hasChanged(FormEntry entry)
hasChanged in interface PObjFormPObjForm.hasChanged(String)
public void populateForm(Record record,
FormEntry[] entries,
boolean setCurrentAsInitial)
For the current value of the corresponding form element for each form entry will the set to the value of the column with the same name within the record.
populateForm in interface PObjFormrecord - The record which should be populated into the form.entries - The form entries whose current values will be set to the
data read from the record.setCurrentAsInitial - if true the new current value of
the changed form elements will also be used as the initial one.PObjForm.getElement(FormEntry)
public final void populateForm(Record record,
FormEntry[] entries)
This method ensures that the new value is also used as initial one.
populateForm in interface PObjFormrecord - The record which should be populated into the form.entries - The form entries whose current values will be set to the
data read from the record.PObjForm.populateForm(Record,FormEntry[],boolean)
public void populateObject(FormEntry[] entries,
Record record,
boolean transferUnchangedValues)
For each specified form entry the current value of the corresponding form element will be written to the column with the same name in the record.
populateObject in interface PObjFormentries - The form entries whose current values will be set to the
data read from the record.record - The record which should be populated into the form.transferUnchangedValues - if false only the values of
form elements that have been changed are copied into the record.PObjForm.getElement(FormEntry)
public final void populateObject(FormEntry[] entries,
Record record)
This method only transfers changed values into the record.
populateObject in interface PObjFormentries - The form entries whose current values will be set to the
data read from the record.record - The record which should be populated into the form.PObjForm.populateObject(FormEntry[],Record,boolean)public void setCurrentAsInitialState()
setCurrentAsInitialState in interface PObjFormpublic void validate()
validate in interface PObjForm
public final void dumpMessages(java.io.PrintStream ps,
java.util.ResourceBundle bundle)
public static java.lang.String getElementLabelKey(FormElement element)
The resource key has the format [<pkgName>.]<formName>.<elementProperty>,
where
pkgNameformNameelementPropertyFor example for the form a.test.Form and element name
the message key would be test.Form.name. Note that if one uses
has different form interfaces for a.test.Form then name will
remains as it for all interfaces.
public static java.lang.Integer[] extractIndexes(java.lang.String property)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||