public class PdoTablePanel<T extends PersistentDomainObject<T>> extends FormPanel
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_CANCEL |
static String |
ACTION_SAVE |
static int |
SHOW_CANCEL_BUTTON |
static int |
SHOW_DELETE_BUTTON |
static int |
SHOW_DOWN_BUTTON |
static int |
SHOW_NEW_BUTTON |
static int |
SHOW_SAVE_BUTTON |
static int |
SHOW_UP_BUTTON |
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_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
PdoTablePanel()
Creates an empty table panel.
|
PdoTablePanel(FormTableEntry<T> template,
List<T> objList,
boolean ordered,
String prefName)
Creates a table panel.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T object)
Adds an object to the list.
In unordered lists the object will always be appended to the end of the list. |
void |
addTableModelListener(TableModelListener l)
Adds a TableModelListener.
|
FormTable<T> |
createFormTable()
Creates the formtable.
|
FormTableModel<T> |
createFormTableModel(FormTableEntry<T> template)
Creates the formtable model for a given object.
|
protected T |
createPdo()
Creates a pdo for the table.
|
boolean |
delete()
Deletes the current object (row).
|
FormPanel |
getButtonPanel()
Gets the button panel.
Applications may add or remove buttons. |
boolean |
getButtonsLessObtrusive() |
FormButton |
getCancelButton()
Get access to the cancel button.
|
FormButton |
getDeleteButton()
Get access to the delete button.
|
FormTable<T> |
getFormTable()
Gets the table.
|
FormTableModel<T> |
getFormTableModel()
Gets the table model.
|
FormTableSorter<T> |
getFormTableSorter()
Gets the table sorter.
|
FormButton |
getMoveDownButton()
Get access to the move-down button.
|
FormButton |
getMoveUpButton()
Get access to the move-up button.
|
FormButton |
getNewButton()
Get access to the new button.
|
boolean |
getNewBySearch()
Gets the setting what happens when the new-button is pressed.
|
FormButton |
getSaveButton()
Get access to the save button.
|
String |
getTableName()
Gets the table preferences name.
|
FormTableEntry<T> |
getTemplate()
Gets the template.
|
int |
getVisibleButtons()
Gets the visible buttons mask
|
boolean |
isCancelButtonVisible()
Gets the visibility of the cancel button.
|
boolean |
isDataChanged()
Gets status info whether data has been changed or not.
|
boolean |
isDeleteButtonVisible()
Gets the visibility of the delete button.
|
boolean |
isDownButtonVisible()
Gets the visibility of the down button.
|
boolean |
isNewButtonVisible()
Gets the visibility of the save button.
|
boolean |
isOrdered()
Gets the ordered feature.
|
boolean |
isSaveButtonVisible()
Gets the visibility of the save button.
|
boolean |
isUnique()
Gets the flag whether objects can be added more than once.
|
boolean |
isUpButtonVisible()
Gets the visibility of the up button.
|
void |
listChanged(List<T> objList)
Shows a list of data objects.
|
void |
move(boolean down)
Moves the current object (row) in list up or down.
|
void |
removeTableModelListener(TableModelListener l)
Removes a TableModelListener.
|
T |
searchObject()
If newBySearch is enabled this method is invoked to run the search.
|
void |
setButtonsLessObtrusive(boolean flag)
Makes the buttons less obtrusive.
|
void |
setCancelButtonVisible(boolean visible)
Sets the visibility of the cancel button.
|
void |
setChangeable(boolean changeable) |
void |
setDeleteButtonVisible(boolean visible)
Sets the visibility of the delete button.
|
void |
setDownButtonVisible(boolean visible)
Sets the visibility of the down button.
|
void |
setNewButtonVisible(boolean visible)
Sets the visibility of the new button.
|
void |
setNewBySearch(boolean newBySearch)
Defines what happens when the new-button is pressed.
|
void |
setOrdered(boolean ordered)
Defines whether the data is ordered or not.
|
void |
setSaveButtonVisible(boolean visible)
Sets the visibility of the save button.
|
void |
setTableName(String prefName)
Sets the table name which is used to load the preferences.
|
void |
setTemplate(FormTableEntry<T> template)
Changes the template (necessary if context changed).
|
void |
setUnique(boolean unique)
Defines whether objects may not appear more than once.
Setting unique makes only sense if newBySearch is enabled as well. |
void |
setup(FormTableEntry<T> template,
List<T> objList,
boolean ordered,
String prefName)
Creates a table panel.
|
void |
setUpButtonVisible(boolean visible)
Sets the visibility of the up button.
|
void |
setVisibleButtons(int mask)
Sets the visible buttons mask.
|
addActionListener, areValuesChanged, componentAdded, componentRemoved, createBinder, fireActionPerformed, getBinder, getFormValues, getHelpURL, getParentWindow, getPropertyGroup, getTitle, invalidateParentInfo, isAutoUpdate, isBindable, isChangeable, isHonourChangeable, isTriggerValuesChangedEnabled, removeActionListener, saveValues, setAutoUpdate, setBindable, 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, transferFocusUpCyclepublic static final String ACTION_SAVE
public static final String ACTION_CANCEL
public static final int SHOW_CANCEL_BUTTON
public static final int SHOW_DELETE_BUTTON
public static final int SHOW_DOWN_BUTTON
public static final int SHOW_UP_BUTTON
public static final int SHOW_SAVE_BUTTON
public static final int SHOW_NEW_BUTTON
public PdoTablePanel(FormTableEntry<T> template, List<T> objList, boolean ordered, String prefName)
template - template for the table-rowobjList - list of PDOsordered - true if objList is an ordered list, i.e. the position in the objList is relevantprefName - is the FormTable-Name for preferences (installs FormTableUtility-Menu too), null = none (no Menu either)public PdoTablePanel()
public void setup(FormTableEntry<T> template, List<T> objList, boolean ordered, String prefName)
template - the template for the table-rowobjList - the list of PDOsordered - true if objList is an ordered list, i.e. the position in the objList is relevantprefName - the FormTable-Name for preferences (installs FormTableUtility-Menu too), null = none (no Menu either)public FormTable<T> createFormTable()
public FormTableModel<T> createFormTableModel(FormTableEntry<T> template)
The default implementation just creates the model and binds it.
template - the formtable entrypublic FormPanel getButtonPanel()
public void setOrdered(boolean ordered)
ordered - true if sort necessary, false no sortpublic boolean isOrdered()
public void setNewBySearch(boolean newBySearch)
newBySearch - true if open a search dialog to select object, else createPdo empty objectpublic boolean getNewBySearch()
public T searchObject()
public void setUnique(boolean unique)
Notice that the initial object list is not checked, i.e. the flag applies only to newly added objects.
unique - true if objects may not appear more than oncepublic boolean isUnique()
public void setTableName(String prefName)
prefName - the table name, null = none (uninstalls the popup, if any)public String getTableName()
public void setVisibleButtons(int mask)
mask - is a bitmask of SHOW_..._BUTTONpublic int getVisibleButtons()
public void setCancelButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isCancelButtonVisible()
public void setDeleteButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isDeleteButtonVisible()
public void setDownButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isDownButtonVisible()
public void setUpButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isUpButtonVisible()
public void setSaveButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isSaveButtonVisible()
public void setNewButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isNewButtonVisible()
public void setButtonsLessObtrusive(boolean flag)
flag - true for less obstrusive buttons, false is default.public FormButton getCancelButton()
public FormButton getDeleteButton()
public FormButton getMoveDownButton()
public FormButton getMoveUpButton()
public FormButton getSaveButton()
public FormButton getNewButton()
public boolean getButtonsLessObtrusive()
public void setTemplate(FormTableEntry<T> template)
template - the templatepublic FormTableEntry<T> getTemplate()
public void setChangeable(boolean changeable)
setChangeable in interface FormChangeablesetChangeable in class FormPanelpublic void listChanged(List<T> objList)
objList - the list of objectspublic boolean isDataChanged()
public FormTableModel<T> getFormTableModel()
public FormTableSorter<T> getFormTableSorter()
public void addTableModelListener(TableModelListener l)
l - the listener to addpublic void removeTableModelListener(TableModelListener l)
l - the listener to removepublic void move(boolean down)
down - true if move down, else uppublic boolean add(T object)
Notice: if the unique attribute is set, objects will not be inserted more than once.
object - the object to addpublic boolean delete()
protected T createPdo()
Tentackle - distributed, domain- and model-driven