public class PdoEditDialogPool extends Object
PdoEditDialogs.
The pool reduces memory consumption and dialog startup time. Furthermore, it makes sure that each object is being edited only once.
Notice that the pool is not mt-safe (as it is the case with Swing in general).
| Constructor and Description |
|---|
PdoEditDialogPool()
Creates a dialog pool
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDialog(PdoEditDialog<?> d)
Adds a dialog to the pool.
|
void |
clear()
Clears the pool.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
createPdoEditDialog(Component comp,
T pdo,
boolean modal)
Creates a new PdoEditDialog.
|
boolean |
delete(org.tentackle.pdo.PersistentDomainObject<?> object)
Deletes an
Pdo.The user will be prompted for confirmation. |
void |
disposeAllDialogs()
Disposes all dialogs.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
edit(T object)
Edits an
Pdo in a non-modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
edit(T object,
boolean disposeOnDeleteOrSave)
Edits an
Pdo in a non-modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
edit(T object,
Component comp,
boolean disposeOnDeleteOrSave)
Edits an
Pdo in a non-modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
editModal(T object)
Edits an
Pdo in a modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
editModal(T object,
Component comp)
Edits an
Pdo in a modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
getDialog(Class<T> objectClass,
boolean modal,
boolean changeable)
Checks whether an unused dialog can be used from the pool.
|
static PdoEditDialogPool |
getInstance()
The singleton.
|
boolean |
isEnabled()
Gets the pool's enabled state.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
isObjectBeingEdited(T object)
Determines whether a given object is currently being edited
by some other dialog.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
isObjectBeingEdited(T object,
PdoEditDialog<T> exceptMe)
Determines whether a given object is currently being edited
by some other dialog.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
isObjectBeingEdited(T object,
PdoEditDialog<T> exceptMe,
Comparator<? super org.tentackle.pdo.PersistentDomainObject<?>> comp)
Determines whether a given object is currently being edited
by some other dialog.
|
boolean |
isPdoEditedOnlyOnce()
Returns whether an object is allowed to be edited only once at a time.
|
void |
removeDialog(PdoEditDialog<?> d)
Removes a dialog from the pool.
|
void |
setEnabled(boolean enabled)
Sets the pool's enabled state.
|
void |
setPdoEditedOnlyOnce(boolean pdoEditedOnlyOnce)
Sets whether an object is allowed to be edited only once at a time.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useModalDialog(Component comp,
T object,
boolean changeable)
Gets a modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useModalDialog(Component comp,
T object,
boolean changeable,
boolean noPersistence)
Gets a modal dialog ready for use.
Will re-use a pooled dialog if possible, otherwise creates a new one. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useModalDialog(T object,
boolean changeable)
Gets a modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useNonModalDialog(Component comp,
T object,
boolean changeable)
Gets a non-modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useNonModalDialog(Component comp,
T pdo,
boolean changeable,
boolean noPersistence,
boolean disposeOnDeleteOrSave)
Gets a non-modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useNonModalDialog(T object,
boolean changeable)
Gets a non-modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
useNonModalDialog(T object,
boolean changeable,
boolean disposeOnDeleteOrSave)
Gets a non-modal dialog ready for use.
|
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
view(T object)
Shows an
Pdo in a non-modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
view(T object,
Component comp)
Shows an
Pdo in a non-modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
viewModal(T object)
Shows an
Pdo in a modal dialog. |
<T extends org.tentackle.pdo.PersistentDomainObject<T>> |
viewModal(T object,
Component comp)
Shows an
Pdo in a modal dialog. |
public static PdoEditDialogPool getInstance()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true if pool is enabledpublic boolean isPdoEditedOnlyOnce()
public void setPdoEditedOnlyOnce(boolean pdoEditedOnlyOnce)
pdoEditedOnlyOnce - true if objects must not be edited more than once (default)public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> isObjectBeingEdited(T object, PdoEditDialog<T> exceptMe, Comparator<? super org.tentackle.pdo.PersistentDomainObject<?>> comp)
T - the pdo typeobject - the database objectexceptMe - the dialog to exclude from the check, null = nonecomp - the optional comparator, null if "equals"public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> isObjectBeingEdited(T object, PdoEditDialog<T> exceptMe)
T - the pdo typeobject - the database objectexceptMe - the dialog to exclude from the check, null = nonepublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> isObjectBeingEdited(T object)
T - the pdo typeobject - the database objectpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> getDialog(Class<T> objectClass, boolean modal, boolean changeable)
T - the pdo typeobjectClass - the data object classmodal - true if dialog must be modalchangeable - true if dialog must be changeable, false if view-only dialogpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> createPdoEditDialog(Component comp, T pdo, boolean modal)
T - the pdo typecomp - the component to determine the window owner, null if nonepdo - the object template to create a dialog formodal - true if dialog should be modalpublic void addDialog(PdoEditDialog<?> d)
d - the dialog to addpublic void removeDialog(PdoEditDialog<?> d)
d - the dialog to removepublic void clear()
public void disposeAllDialogs()
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> T useModalDialog(Component comp, T object, boolean changeable, boolean noPersistence)
T - the pdo typecomp - the component to determine the owner window forobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialognoPersistence - true if NO changes must be made to persistance layer
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> T useModalDialog(Component comp, T object, boolean changeable)
T - the pdo typecomp - the component to determine the owner window forobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialog
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> T useModalDialog(T object,
boolean changeable)
T - the pdo typeobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialog
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> useNonModalDialog(Component comp, T pdo, boolean changeable, boolean noPersistence, boolean disposeOnDeleteOrSave)
T - the pdo typecomp - the component to determine the owner window forpdo - the PDOchangeable - true if dialog must be changeable, false if view-only dialognoPersistence - true if NO changes must be made to persistance layerdisposeOnDeleteOrSave - true if dispose dialog after delete or save
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> useNonModalDialog(T object, boolean changeable, boolean disposeOnDeleteOrSave)
T - the pdo typeobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialogdisposeOnDeleteOrSave - true if dispose dialog after delete or save
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> useNonModalDialog(Component comp, T object, boolean changeable)
T - the pdo typecomp - the component to determine the owner window forobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialog
public <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoEditDialog<T> useNonModalDialog(T object, boolean changeable)
T - the pdo typeobject - the database objectchangeable - true if dialog must be changeable, false if view-only dialogpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void view(T object,
Component comp)
Pdo in a non-modal dialog.T - the PDO typeobject - the Pdo to view-onlycomp - optional component to determine the window owner, null = no ownerpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void view(T object)
Pdo in a non-modal dialog.T - the PDO typeobject - the Pdo to view-onlypublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void viewModal(T object,
Component comp)
Pdo in a modal dialog.T - the PDO typeobject - the Pdo to view-onlycomp - optional component to determine the window owner, null = no ownerpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void viewModal(T object)
Pdo in a modal dialog.T - the PDO typeobject - the Pdo to view-onlypublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void edit(T object,
Component comp,
boolean disposeOnDeleteOrSave)
Pdo in a non-modal dialog.T - the PDO typeobject - the Pdo to editcomp - optional component to determine the window owner, null = no ownerdisposeOnDeleteOrSave - true if dispose dialog after delete or savepublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void edit(T object,
boolean disposeOnDeleteOrSave)
Pdo in a non-modal dialog.T - the PDO typeobject - the Pdo to editdisposeOnDeleteOrSave - true if dispose dialog after delete or savepublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> void edit(T object)
Pdo in a non-modal dialog.T - the PDO typeobject - the Pdo to editpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> T editModal(T object,
Component comp)
Pdo in a modal dialog.T - the PDO typeobject - the Pdo to editcomp - optional component to determine the window owner, null = no ownerpublic <T extends org.tentackle.pdo.PersistentDomainObject<T>> T editModal(T object)
Pdo in a modal dialog.T - the PDO typeobject - the Pdo to editpublic boolean delete(org.tentackle.pdo.PersistentDomainObject<?> object)
Pdo.object - the Pdo to deleteCopyright © 2016 Krake Softwaretechnik. All rights reserved.