public abstract class AbstractView<T> extends ViewSupport<T> implements View<T>
View implementation.
The central method is buildPanel that builds the JComponent
that hold the view controls. You may use custom binding of the view overwriting the methods
doUpdate and doRefresh.
For common binding code, you usually use autobinding facitility, that is, using
the same name to the field control and model property name, and setting autobinding to true.
When using autobinding, you may exclude model properties from binding using some
of ignoreProperty methods.
Manual binding is also supported via bind methods. When binding a control, a
the View is added to control as ChangeListener is added to the control for setting dirty property on control
changes.
Only org.springframework.util.validation.Validator validators are supported
The validateView method calls configured
ErrorProcessors to process errors found in validation.
BinderFactory,
ControlAccessorFactory,
ErrorProcessor,
Serialized FormDEFAULT_BINDER_FACTORY_NAME, errors, height, messageSource, width| Constructor and Description |
|---|
AbstractView()
Default ctor
|
AbstractView(T model)
Create the view and set the model
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract JComponent |
buildPanel()
Build the JComponent that hold controls.
|
protected void |
checkFactories()
Check if there are binder and control accessor factories configured, if not
use defaults.
|
JComponent |
getPanel() |
addControlChangeListener, addError, addView, afterRefresh, afterUpdate, autobind, bind, bind, clear, controlChange, doRefresh, doUpdate, enableView, fireControlChange, getBinder, getBinderFactory, getBindingResult, getControlAccessorFactory, getControlInitializer, getErrorMessage, getErrorProcessors, getHeight, getIgnoredProperties, getMessage, getMessage, getMessage, getMessageSource, getModel, getName, getValidator, getWidth, ignoreProperties, ignoreProperty, isDirty, isInitializeControls, listen, onSetModel, refresh, removeControlChangeListener, setBinderFactory, setControlAccessorFactory, setControlInitializer, setDirty, setErrorProcessors, setHeight, setIgnoredProperties, setInitializeControls, setMessageSource, setModel, setName, setValidator, setWidth, update, validateViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddControlChangeListener, clear, enableView, getErrorMessage, getName, isDirty, removeControlChangeListener, validateViewgetBindingResult, refresh, updategetModel, setModelpublic AbstractView()
public AbstractView(T model)
model - model to setpublic JComponent getPanel()
protected abstract JComponent buildPanel()
protected void checkFactories()
checkFactories in class ViewSupport<T>Copyright © 2014 JDAL. All Rights Reserved.