|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.tentackle.ui.FormPanel
org.tentackle.appworx.AppDbObjectPanel
public class AppDbObjectPanel
Panel to view and/or edit an AppDbObject.
The panel is designed to used as a plugin by AppDbObjectDialog.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected AppDbObjectDialog |
dialog
the enclosing AppDbObjectDialog, null if none |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.print.Pageable |
|---|
UNKNOWN_NUMBER_OF_PAGES |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AppDbObjectPanel()
|
|
| Method Summary | |
|---|---|
AppDbObjectDialog |
getAppDbObjectDialog()
Gets the parent AppDbObjectDialog. |
int |
getNumberOfPages()
Returns the number of pages in the set. |
AppDbObject |
getObject()
Gets the currently displayed database object. |
Pageable |
getPageable(PrinterJob printJob)
Gets the Pageable of this panel.AppDbObjectDialog invokes this method if the "print" button is pressed. |
PageFormat |
getPageFormat(int pageIndex)
Returns the PageFormat of the page specified by
pageIndex. |
Printable |
getPrintable(int pageIndex)
Returns the Printable instance responsible for
rendering the page specified by pageIndex. |
Printable |
getPrintable(PrinterJob printJob)
Gets the Printable of this panel.AppDbObjectDialog invokes this method if the "print" button is pressed and getPageable() returned null. |
String |
getTitle()
Gets the container's title. |
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)
Prints the page at the specified index into the specified Graphics context in the specified
format. |
void |
setAppDbObjectDialog(AppDbObjectDialog dialog)
Sets the parent AppDbObjectDialog. |
void |
setInitialFocus()
Sets the initial focus. Usually requests the focus for the top left component. |
boolean |
setObject(AppDbObject object)
Sets the database object and updates the view. |
List<InteractiveError> |
verifyObject()
Verifies the data object. |
| Methods inherited from class org.tentackle.ui.FormPanel |
|---|
addActionListener, areValuesChanged, componentAdded, componentRemoved, fireActionPerformed, getFormValues, getHelpURL, getParentWindow, invalidateParentInfo, isAllChangeable, isHonourAllChangeable, removeActionListener, saveValues, setAllChangeable, setFormValues, setFormValuesKeepChanged, setHelpURL, setHonourAllChangeable, setTitle, showHelp, triggerValuesChanged |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AppDbObjectDialog dialog
AppDbObjectDialog, null if none
| Constructor Detail |
|---|
public AppDbObjectPanel()
| Method Detail |
|---|
public boolean setObject(AppDbObject object)
The default implementation returns false. Must be overridden!
object - the database object
public AppDbObject getObject()
The default implementation returns null. Must be overridden!
public List<InteractiveError> verifyObject()
The default implementation invokes AppDbObject.verify().
public boolean prepareSave()
AppDbObjectDialog 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()
The default implementation returns true.
public void setAppDbObjectDialog(AppDbObjectDialog dialog)
AppDbObjectDialog.
Invoked from AppDbObjectDialog when this panel
is "plugged in".
dialog - the parent dialogpublic AppDbObjectDialog getAppDbObjectDialog()
AppDbObjectDialog.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 job
public Printable getPrintable(PrinterJob printJob)
Printable of this panel.this, which is simply
a screendump of this panel.
printJob - the printer job
public void markPrinted()
public int print(Graphics graphics,
PageFormat pageFormat,
int pageIndex)
Graphics context in the specified
format. A PrinterJob calls the
Printable interface to request that a page be
rendered into the context specified by
graphics. The format of the page to be drawn is
specified by pageFormat. The zero based index
of the requested page is specified by pageIndex.
If the requested page does not exist then this method returns
NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned.
The Graphics class or subclass implements the
PrinterGraphics interface to provide additional
information. If the Printable object
aborts the print job then it throws a PrinterException.
The default implementation prints a screendump of this panel.
print in interface Printablegraphics - the context into which the page is drawnpageFormat - the size and orientation of the page being drawnpageIndex - the zero based index of the page to be drawn
pageIndex specifies a
non-existent page.public Printable getPrintable(int pageIndex)
Printable instance responsible for
rendering the page specified by pageIndex.
The default implementation returns this.
getPrintable in interface PageablepageIndex - the zero based index of the page whose
Printable is being requested
Printable that renders the page.public PageFormat getPageFormat(int pageIndex)
PageFormat of the page specified by
pageIndex.
The default implementation returns the default pageformat of the printjob.
getPageFormat in interface PageablepageIndex - the zero based index of the page whose
PageFormat is being requested
PageFormat describing the size and
orientation.public int getNumberOfPages()
Pageable
implementations return the true number of pages
rather than the
UNKNOWN_NUMBER_OF_PAGES constant.
The default implementation returns UNKNOWN_NUMBER_OF_PAGES.
getNumberOfPages in interface PageablePageable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||