|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.common.bean.AbstractBean
com.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
,
Serialized FormField Summary | |
---|---|
static String |
PROPERTYNAME_EXPANDED
The name of the bound read-write property for the expansion state. |
Fields inherited from class com.jgoodies.common.bean.AbstractBean |
---|
changeSupport |
Fields inherited from interface com.jgoodies.validation.ValidationResultModel |
---|
PROPERTY_ERRORS, PROPERTY_MESSAGES, PROPERTY_RESULT, PROPERTY_SEVERITY, 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. |
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 |
---|
firePropertyChanges, getSeverity, hasErrors, hasMessages |
Methods inherited from class com.jgoodies.common.bean.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPropertyChangeSupport, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jgoodies.common.bean.ObservableBean2 |
---|
addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener |
Methods inherited from interface com.jgoodies.common.bean.ObservableBean |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
public static final String PROPERTYNAME_EXPANDED
isExpanded()
,
setExpanded(boolean)
,
Constant Field ValuesConstructor 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
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 ValidationResultModel
setResult
in class DefaultValidationResultModel
newResult
- the validation result to be set (ignored)
UnsupportedOperationException
- alwaysDefaultValidationResultModel.getResult()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |