|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jgoodies.validation.util.AbstractValidationResultModel
com.jgoodies.validation.util.DefaultValidationResultModel
com.jgoodies.validation.util.ValidationResultModelContainer
public class ValidationResultModelContainer
A validation result model that holds multiple validation results.
These can be concatenated or collapsed, see setExpanded(boolean),
getCollapsedValidationResult().
TODO: The collapsed validation result shall honor the severity as reported by the expanded validation result.
TODO: The expanded validation result shall be cached.
DefaultValidationResultModel| Field Summary | |
|---|---|
static java.lang.String |
PROPERTYNAME_EXPANDED
The name of the bound read-write property for the expansion state. |
| Fields inherited from interface com.jgoodies.validation.ValidationResultModel |
|---|
PROPERTYNAME_ERRORS, PROPERTYNAME_MESSAGES, PROPERTYNAME_RESULT, PROPERTYNAME_SEVERITY |
| Constructor Summary | |
|---|---|
ValidationResultModelContainer(ValidationMessage collapsedMessage)
Constructs a ValidationResultModelContainer using the
given validation message for the collapsed state. |
|
| Method Summary | |
|---|---|
void |
add(ValidationResultModel resultModel)
Adds the given ValidationResultModel to this container's list
of children and registers the container to listen for changes in the child. |
ValidationResult |
getCollapsedValidationResult()
Returns the collapsed validation result, i. e. a ValidationResult
that just consists of a single ValidationMessage; in this case
the collapsed validation message. |
ValidationResult |
getExpandedValidationResult()
Returns the concatenation of all validation results that are held by this container. |
boolean |
isExpanded()
Returns if this container is in expanded or collapsed state. |
void |
remove(ValidationResultModel resultModel)
Removes the given ValidationResultModel from this container's
list of children. |
void |
setExpanded(boolean newExpanded)
Sets the container state to expanded or collapsed. |
void |
setResult(ValidationResult newResult)
Rejects to set a new validation result. |
| Methods inherited from class com.jgoodies.validation.util.DefaultValidationResultModel |
|---|
getResult |
| Methods inherited from class com.jgoodies.validation.util.AbstractValidationResultModel |
|---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChanges, getPropertyChangeListeners, getPropertyChangeListeners, getSeverity, hasErrors, hasMessages, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTYNAME_EXPANDED
isExpanded(),
setExpanded(boolean),
Constant Field Values| Constructor Detail |
|---|
public ValidationResultModelContainer(ValidationMessage collapsedMessage)
ValidationResultModelContainer using the
given validation message for the collapsed state. The initial state
is expanded.
collapsedMessage - the ValidationMessage used
if the container is in collapsed state
java.lang.NullPointerException - if the collapsed message is null| Method Detail |
|---|
public boolean isExpanded()
setExpanded(boolean)public void setExpanded(boolean newExpanded)
newExpanded - true to expand, false to collapseisExpanded()public ValidationResult getCollapsedValidationResult()
ValidationResult
that just consists of a single ValidationMessage; in this case
the collapsed validation message.TODO: Consider changing the implementation to
ValidationResult wrapper = new ValidationResult();
if (getExpandedValidationResult().hasMessages()) {
wrapper.add(collapsedMessage);
}
return wrapper;
getExpandedValidationResult()public ValidationResult getExpandedValidationResult()
getCollapsedValidationResult()public void add(ValidationResultModel resultModel)
ValidationResultModel to this container's list
of children and registers the container to listen for changes in the child.
resultModel - the ValidationResultModel to be addedremove(ValidationResultModel)public void remove(ValidationResultModel resultModel)
ValidationResultModel from this container's
list of children. Also unregisters this container to no longer listen
for changes in the child.
resultModel - the ValidationResultModel to be removedadd(ValidationResultModel)public final void setResult(ValidationResult newResult)
UnsupportedOperationException.
setResult in interface ValidationResultModelsetResult in class DefaultValidationResultModelnewResult - the validation result to be set (ignored)
java.lang.UnsupportedOperationException - alwaysDefaultValidationResultModel.getResult()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||