T - the PDO typepublic class PdoPanel<T extends PersistentDomainObject<T>> extends FormPanel implements DomainContextProvider, Printable, Pageable
PersistentDomainObject.
The panel is designed to used as a plugin by PdoEditDialog.
Notice: the class should be abstract but most GUI-designers cannot
handle abstract classes and need a bean to instantiate.
Hence, some methods that should be abstract as well are non-abstract
default implementations that *must* be overridden.
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected PdoEditDialog<T> |
dialog
the enclosing
PdoEditDialog, null if none |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTNO_SUCH_PAGE, PAGE_EXISTSUNKNOWN_NUMBER_OF_PAGESABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
PdoPanel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
announceDelete()
Announce that a delete is going to happen.
As opposed to prepareDelete() this method
is invoked by PdoEditDialog before the transaction is started. |
boolean |
announceSave()
Announce that a save is going to happen.
As opposed to prepareSave() this method
is invoked by PdoEditDialog before the transaction is started. |
InteractiveError |
createInteractiveError(org.tentackle.validate.ValidationResult validationResult)
Creates an interactive error from a validation result.
|
List<InteractiveError> |
createInteractiveErrors(List<org.tentackle.validate.ValidationResult> validationResults)
Creates interactive errors from validation results.
|
DomainContext |
getDomainContext() |
int |
getNumberOfPages() |
Pageable |
getPageable(PrinterJob printJob)
Gets the
Pageable of this panel.PdoEditDialog invokes this method if the "print" button is pressed. |
PageFormat |
getPageFormat(int pageIndex) |
T |
getPdo()
Gets the currently displayed database object.
|
PdoEditDialog<T> |
getPdoEditDialog()
Gets the parent PdoEditDialog.
|
Printable |
getPrintable(int pageIndex) |
Printable |
getPrintable(PrinterJob printJob)
Gets the
Printable of this panel.PdoEditDialog invokes this method if the "print" button is pressed and getPageable() returned null. |
String |
getTitle() |
void |
markPrinted()
Indicates a successful printout.
The default implementation does nothing. |
void |
pack()
Packs the parent window.
|
boolean |
prepareCancel()
Prepares the cancel operation.
Invoked when the dialog is closed or the object is removed from the panel in general. |
boolean |
prepareDelete()
Prepares to delete the current object.
Invoked when the user wants to delete the current object (presses the "delete" button, for example). |
boolean |
prepareNew()
Prepares to create a new object.
Invoked when the user instantiates a new object (presses the "new" button, for example). |
boolean |
prepareSave()
Checks the object for consistency before it is saved.
This method must *NOT* do any modifications to the database. |
boolean |
prepareSearch()
Prepares to search for objects.
Invoked when the user wants to search for objects (presses the "search" button, for example). |
int |
print(Graphics graphics,
PageFormat pageFormat,
int pageIndex) |
void |
setInitialFocus()
Sets the initial focus.
Usually requests the focus for the top left component. |
boolean |
setPdo(T object)
Sets the database object and updates the view.
|
void |
setPdoEditDialog(PdoEditDialog<T> dialog)
Sets the parent
PdoEditDialog. |
List<InteractiveError> |
verifyObject()
Verifies the data object.
|
addActionListener, areValuesChanged, componentAdded, componentRemoved, createBinder, fireActionPerformed, getBinder, getFormValues, getHelpURL, getParentWindow, getPropertyGroup, invalidateParentInfo, isAutoUpdate, isBindable, isChangeable, isHonourChangeable, isTriggerValuesChangedEnabled, removeActionListener, saveValues, setAutoUpdate, setBindable, setChangeable, setFormValues, setFormValuesKeepChanged, setHelpURL, setHonourChangeable, setPropertyGroup, setTitle, setTriggerValuesChangedEnabled, showHelp, triggerValuesChangedgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiton, opprotected PdoEditDialog<T extends PersistentDomainObject<T>> dialog
PdoEditDialog, null if none@Bindable public boolean setPdo(T object)
The default implementation returns false. Must be overridden!
object - the database object@Bindable public T getPdo()
The default implementation returns null. Must be overridden!
public DomainContext getDomainContext()
getDomainContext in interface DomainContextProviderpublic List<InteractiveError> verifyObject()
Holds verification before the object is actually saved.
public boolean prepareSave()
PdoEditDialog within the transaction
of saving the object.
The default implementation invokes verifyObject().
public boolean prepareCancel()
The default implementation returns true.
public boolean prepareNew()
The default implementation returns true.
public boolean prepareSearch()
The default implementation returns true.
public boolean prepareDelete()
This method must *NOT* do any modifications to the database.
It is invoked from PdoEditDialog within the transaction
deleting the object.
The default implementation returns true.
public boolean announceDelete()
prepareDelete() this method
is invoked by PdoEditDialog before the transaction is started.
The default implementation returns true.
public boolean announceSave()
prepareSave() this method
is invoked by PdoEditDialog before the transaction is started.
The default implementation returns true.
public InteractiveError createInteractiveError(org.tentackle.validate.ValidationResult validationResult)
validationResult - the validation resultpublic List<InteractiveError> createInteractiveErrors(List<org.tentackle.validate.ValidationResult> validationResults)
validationResults - the validation resultspublic void setPdoEditDialog(PdoEditDialog<T> dialog)
PdoEditDialog.
Invoked from PdoEditDialog when this panel
is "plugged in".
dialog - the parent dialogpublic PdoEditDialog<T> getPdoEditDialog()
PdoEditDialog.public void setInitialFocus()
public String getTitle()
Overridden to generate the title from the current object if title is null.
getTitle in interface FormContainergetTitle in class FormPanelpublic void pack()
public Pageable getPageable(PrinterJob printJob)
Pageable of this panel.printJob - the printer jobpublic Printable getPrintable(PrinterJob printJob)
Printable of this panel.this, which is simply
a screendump of this panel.printJob - the printer jobpublic void markPrinted()
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
The default implementation prints a screendump of this panel.
public Printable getPrintable(int pageIndex)
The default implementation returns this.
getPrintable in interface Pageablepublic PageFormat getPageFormat(int pageIndex)
The default implementation returns the default pageformat of the printjob.
getPageFormat in interface Pageablepublic int getNumberOfPages()
The default implementation returns UNKNOWN_NUMBER_OF_PAGES.
getNumberOfPages in interface PageableTentackle - distributed, domain- and model-driven