public class ValidationResultModelContainer extends DefaultValidationResultModel
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 Form| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_EXPANDED
The name of the bound read-write property for the expansion state.
|
PROPERTY_ERRORS, PROPERTY_MESSAGES, PROPERTY_RESULT, PROPERTY_SEVERITY| Constructor and Description |
|---|
ValidationResultModelContainer(ValidationMessage collapsedMessage)
Constructs a
ValidationResultModelContainer using the
given validation message for the collapsed state. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getResultfirePropertyChanges, getSeverity, hasErrors, hasMessagesaddPropertyChangeListener, 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, removeVetoableChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String PROPERTY_EXPANDED
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 stateNullPointerException - if the collapsed message is nullpublic 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)UnsupportedOperationException - alwaysDefaultValidationResultModel.getResult()Copyright © 2003-2014 JGoodies Software GmbH. All Rights Reserved.