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 FormModifier and Type | Field and Description |
---|---|
static String |
PROPERTYNAME_EXPANDED
The name of the bound read-write property for the expansion state.
|
PROPERTY_ERRORS, PROPERTY_MESSAGES, PROPERTY_RESULT, PROPERTY_SEVERITY, PROPERTYNAME_ERRORS, PROPERTYNAME_MESSAGES, PROPERTYNAME_RESULT, PROPERTYNAME_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.
|
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.
|
getResult
firePropertyChanges, getSeverity, hasErrors, hasMessages
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final String PROPERTYNAME_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 null
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()
Copyright © 2003-2011 JGoodies Karsten Lentzsch. All Rights Reserved.