|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.application.support.ApplicationServicesAccessor
org.springframework.richclient.factory.AbstractControlFactory
org.springframework.richclient.form.AbstractForm
org.springframework.richclient.form.AbstractMasterForm
public abstract class AbstractMasterForm
Abstract base for the Master form of a Master/Detail pair. Derived types must implement two methods:
createDetailForm(org.springframework.binding.form.HierarchicalFormModel, org.springframework.binding.value.ValueModel, org.springframework.binding.value.support.ObservableList)
getSelectionModel()
Important note: Any subclass that implements
AbstractForm.createControl()
MUST call configure()
prior to its work in order to have the detail form properly prepared.
AbstractDetailForm
,
creatingNewObject()
Nested Class Summary | |
---|---|
protected class |
AbstractMasterForm.ListSelectionHandler
Inner class to handle the list selection and installing the selection into the detail form. |
Field Summary | |
---|---|
static String |
IS_CREATING_PROPERTY
Property name for indicating changes in our "is creating new object" state. |
static String |
SELECTION_INDEX_PROPERTY
Property name for indicating changes in our selected index. |
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
---|
logger |
Constructor Summary | |
---|---|
protected |
AbstractMasterForm(HierarchicalFormModel parentFormModel,
String property,
String formId,
Class detailType)
Construct a new AbstractMasterForm using the given parent form model and property path. |
Method Summary | |
---|---|
protected void |
configure()
Configure this master form's data and prepare the detail form. |
protected JComponent |
createButtonBar()
Return a standardized row of command buttons, right-justified and all of the same size, with OK as the default button, and no mnemonics used, as per the Java Look and Feel guidelines. |
protected JButton |
createDeleteButton()
Construct the button to invoke the delete command. |
protected ActionCommand |
createDeleteCommand()
Create the "delete object" command. |
protected abstract AbstractDetailForm |
createDetailForm(HierarchicalFormModel parentFormModel,
ValueModel valueHolder,
ObservableList masterList)
Construct the detail half of this master/detail pair. |
protected ActionCommand |
createNewFormObjectCommand()
Create the "new detail object" command. |
void |
creatingNewObject()
Indicates that we are creating a new detail object. |
protected void |
deleteSelectedItems()
Delete the detail item at the specified index. |
ValueModel |
getCollectionValueModel()
Get the value model representing the collection we are managing. |
protected CommandGroup |
getCommandGroup()
Get the command group for the master table (the add and delete commands). |
protected String |
getConfirmDeleteMessage()
Get the message to present to the user when confirming the delete of selected detail items. |
ActionCommand |
getDeleteCommand()
Return the command to delete the currently selected item in the master set. |
protected String |
getDeleteCommandId()
Construct the "delete detail object" command id as delete[DetailTypeName]Command |
protected AbstractDetailForm |
getDetailForm()
|
protected ValidatingFormModel |
getDetailFormModel()
|
protected Class |
getDetailType()
|
List |
getFormData()
Get the form data we are operating upon. |
protected Class |
getMasterCollectionType(ValueModel collectionPropertyVM)
Determine the type of the collection holding the detail items. |
ObservableEventList |
getMasterEventList()
Get the master EventList (which proxies the real form data). |
ActionCommand |
getNewFormObjectCommand()
Get the action command to creating a new detail object. |
protected String |
getNewFormObjectCommandId()
Construct the "new detail object" command id as new[detailTypeName]Command |
protected JPopupMenu |
getPopupMenu()
Get the popup menu for the master table. |
protected ca.odell.glazedlists.EventList |
getRootEventList()
Get the root event list for this model. |
protected ListSelectionListener |
getSelectionHandler()
Get the selection handler for the master list. |
protected abstract ListSelectionModel |
getSelectionModel()
Get the selection model for the master list representation. |
protected void |
handleExternalRootEventListChange()
Handle the root event list being changed externally. |
protected void |
installEventList(ca.odell.glazedlists.EventList eventList)
Install an EventList for use as our master list data. |
protected void |
installSelectionHandler()
Install our selection handler. |
boolean |
isConfirmDelete()
Return confirm delete setting. |
protected void |
maybeCreateNewObject()
Deal with the user invoking a "new object" command. |
protected void |
maybeDeleteSelectedItems()
Maybe delete the selected items. |
ValidationResultsReporter |
newSingleLineResultsReporter(Messagable messageReceiver)
When the results reporter is setup on the master form, we need to capture it and forward it on to the detail form as well. |
void |
setConfirmDelete(boolean confirmDelete)
Set confirm delete. |
protected void |
setDetailForm(AbstractDetailForm form)
|
protected void |
setDetailType(Class type)
|
protected void |
uninstallSelectionHandler()
Uninstall our selection handler. |
protected void |
updateControlsForState()
Update our controls based on our state. |
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory |
---|
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton |
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
---|
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.richclient.factory.ControlFactory |
---|
getControl |
Field Detail |
---|
public static final String SELECTION_INDEX_PROPERTY
public static final String IS_CREATING_PROPERTY
Constructor Detail |
---|
protected AbstractMasterForm(HierarchicalFormModel parentFormModel, String property, String formId, Class detailType)
parentFormModel
- Parent form model to access for this form's dataproperty
- containing this forms data (must be a collection or an array)formId
- Id of this formdetailType
- Type of detail object managed by this master formMethod Detail |
---|
public ValueModel getCollectionValueModel()
You must use this method to get the value model since calling getValueModel on the parent form model will not get you what you want.
protected Class getMasterCollectionType(ValueModel collectionPropertyVM)
Note to Hibernate users: You will most likely need to override this method
in order to force the use of a simple List
class instead of the
default implementation that would return PersistentList
. Creating a
new instance of this type would result in a somewhat misleading error regarding
lazy instantiation since the new PersistentList instance would not have been
properly initialized by Hibernate.
collectionPropertyVM
- ValueModel holding the master collection
protected void configure()
protected abstract AbstractDetailForm createDetailForm(HierarchicalFormModel parentFormModel, ValueModel valueHolder, ObservableList masterList)
parentFormModel
- valueHolder
- BufferedValueModel holding an object of the type configured for
this master form.masterList
- The ObservableList of data to from the master form (this will
constitute the editable object list for the detail form).protected void installEventList(ca.odell.glazedlists.EventList eventList)
getRootEventList()
so that
all changes are propery proxied onto the actual form data. The event list provided
will be wrapped in a ObservableEventList
.
eventList
- new EventList to installprotected ca.odell.glazedlists.EventList getRootEventList()
protected void handleExternalRootEventListChange()
parentFormPropertyChangeHandler
public List getFormData()
public ObservableEventList getMasterEventList()
protected abstract ListSelectionModel getSelectionModel()
protected void installSelectionHandler()
protected void uninstallSelectionHandler()
public void creatingNewObject()
protected ListSelectionListener getSelectionHandler()
protected CommandGroup getCommandGroup()
protected JComponent createButtonBar()
protected JPopupMenu getPopupMenu()
getCommandGroup()
.
public ActionCommand getNewFormObjectCommand()
getNewFormObjectCommand
in class AbstractForm
protected ActionCommand createNewFormObjectCommand()
AbstractForm.getNewFormObjectCommand()
as well as controlling
the state of the detail form.
protected String getNewFormObjectCommandId()
new[detailTypeName]Command
getNewFormObjectCommandId
in class AbstractForm
public ActionCommand getDeleteCommand()
protected ActionCommand createDeleteCommand()
protected String getConfirmDeleteMessage()
<formId>.confirmDelete.message
or
masterForm.confirmDelete.message
. Subclasses can use the selected
item(s) to construct a more meaningful message.
protected void maybeDeleteSelectedItems()
protected void deleteSelectedItems()
protected JButton createDeleteButton()
protected String getDeleteCommandId()
delete[DetailTypeName]Command
protected AbstractDetailForm getDetailForm()
protected void setDetailForm(AbstractDetailForm form)
form
- The detailForm to set.protected ValidatingFormModel getDetailFormModel()
protected Class getDetailType()
protected void setDetailType(Class type)
type
- The detailType to set.public boolean isConfirmDelete()
public void setConfirmDelete(boolean confirmDelete)
true
then the master form will
confirm with the user prior to deleting a detail item.
confirmDelete
- protected void maybeCreateNewObject()
protected void updateControlsForState()
public ValidationResultsReporter newSingleLineResultsReporter(Messagable messageReceiver)
newSingleLineResultsReporter
in interface Form
newSingleLineResultsReporter
in class AbstractForm
messageReceiver
- the message receiver used by the created
resultsReporter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |