org.tentackle.appworx
Class AppDbObjectTablePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.tentackle.ui.FormPanel
                      extended by org.tentackle.appworx.AppDbObjectTablePanel
All Implemented Interfaces:
ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, FormContainer

public class AppDbObjectTablePanel
extends FormPanel

See Also:
Serialized Form

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
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
           
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AppDbObjectTablePanel()
          Creates an empty table panel.
AppDbObjectTablePanel(FormTableEntry template, List<? extends AppDbObject> objList, boolean ordered, String prefName)
          Creates a table panel.
 
Method Summary
 void addTableModelListener(TableModelListener l)
          Adds a TableModelListener.
 boolean getButtonsLessObtrusive()
           
 FormButton getCancelButton()
          Get access to the cancel button.
 FormButton getDeleteButton()
          Get access to the delete button.
 FormTable getFormTable()
          Gets the table.
 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 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<? extends AppDbObject> objList)
          Shows a list of data objects.
 void removeTableModelListener(TableModelListener l)
          Removes a TableModelListener.
 AppDbObject searchObject()
          If newBySearch is enabled this method is invoked to run the search.
 void setAllChangeable(boolean changeable)
          Sets the changeable attribute of all components of this container and all sub containers.
 void setButtonsLessObtrusive(boolean flag)
          Makes the buttons less obtrusive.
 void setCancelButtonVisible(boolean visible)
          Sets the visibility of the cancel button.
 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 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 template, List<? extends AppDbObject> 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.
 
Methods inherited from class org.tentackle.ui.FormPanel
addActionListener, areValuesChanged, componentAdded, componentRemoved, fireActionPerformed, getFormValues, getHelpURL, getParentWindow, getTitle, invalidateParentInfo, isAllChangeable, isHonourAllChangeable, removeActionListener, saveValues, setFormValues, setFormValuesKeepChanged, setHelpURL, setHonourAllChangeable, setTitle, showHelp, triggerValuesChanged
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, update
 
Methods inherited from class java.awt.Container
add, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_SAVE

public static final String ACTION_SAVE
See Also:
Constant Field Values

ACTION_CANCEL

public static final String ACTION_CANCEL
See Also:
Constant Field Values

SHOW_CANCEL_BUTTON

public static final int SHOW_CANCEL_BUTTON
See Also:
Constant Field Values

SHOW_DELETE_BUTTON

public static final int SHOW_DELETE_BUTTON
See Also:
Constant Field Values

SHOW_DOWN_BUTTON

public static final int SHOW_DOWN_BUTTON
See Also:
Constant Field Values

SHOW_UP_BUTTON

public static final int SHOW_UP_BUTTON
See Also:
Constant Field Values

SHOW_SAVE_BUTTON

public static final int SHOW_SAVE_BUTTON
See Also:
Constant Field Values

SHOW_NEW_BUTTON

public static final int SHOW_NEW_BUTTON
See Also:
Constant Field Values
Constructor Detail

AppDbObjectTablePanel

public AppDbObjectTablePanel(FormTableEntry template,
                             List<? extends AppDbObject> objList,
                             boolean ordered,
                             String prefName)
Creates a table panel.

Parameters:
template - template for the table-row
objList - list of AppDbObjects
ordered - true if objList is an ordered list, i.e. the position in the objList is relevant
prefName - is the FormTable-Name for preferences (installs FormTableUtility-Menu too), null = none (no Menu either)

AppDbObjectTablePanel

public AppDbObjectTablePanel()
Creates an empty table panel. (Constructor for UI-Designer)

Method Detail

setup

public void setup(FormTableEntry template,
                  List<? extends AppDbObject> objList,
                  boolean ordered,
                  String prefName)
Creates a table panel.

Parameters:
template - the template for the table-row
objList - the list of AppDbObjects
ordered - true if objList is an ordered list, i.e. the position in the objList is relevant
prefName - the FormTable-Name for preferences (installs FormTableUtility-Menu too), null = none (no Menu either)

setOrdered

public void setOrdered(boolean ordered)
Defines whether the data is ordered or not.

Parameters:
ordered - true if sort necessary, false no sort

isOrdered

public boolean isOrdered()
Gets the ordered feature.

Returns:
true if ordered

setNewBySearch

public void setNewBySearch(boolean newBySearch)
Defines what happens when the new-button is pressed. By default an empty object will be inserted.

Parameters:
newBySearch - true if open a search dialog to select object, else create empty object

getNewBySearch

public boolean getNewBySearch()
Gets the setting what happens when the new-button is pressed.

Returns:
true if open a search dialog to select object, else create empty object

searchObject

public AppDbObject searchObject()
If newBySearch is enabled this method is invoked to run the search. The default implementation just runs a modal AppDbObjectSearchDialog.

Returns:
the object, null if search cancelled

setUnique

public void setUnique(boolean unique)
Defines whether objects may not appear more than once.
Setting unique makes only sense if newBySearch is enabled as well.

Notice that the initial object list is not checked, i.e. the flag applies only to newly added objects.

Parameters:
unique - true if objects may not appear more than once

isUnique

public boolean isUnique()
Gets the flag whether objects can be added more than once.

Returns:
true if objects are unique, false if not (default)

setTableName

public void setTableName(String prefName)
Sets the table name which is used to load the preferences. Setting the name will also install a FormTableUtilityPopup.

Parameters:
prefName - the table name, null = none (uninstalls the popup, if any)

getTableName

public String getTableName()
Gets the table preferences name.

Returns:
the preferences name

setVisibleButtons

public void setVisibleButtons(int mask)
Sets the visible buttons mask.

Parameters:
mask - is a bitmask of SHOW_..._BUTTON

getVisibleButtons

public int getVisibleButtons()
Gets the visible buttons mask

Returns:
the bitmask of SHOW_...._BUTTON

setCancelButtonVisible

public void setCancelButtonVisible(boolean visible)
Sets the visibility of the cancel button.

Parameters:
visible - is true if visible, false if not

isCancelButtonVisible

public boolean isCancelButtonVisible()
Gets the visibility of the cancel button.

Returns:
true if visible, false if not

setDeleteButtonVisible

public void setDeleteButtonVisible(boolean visible)
Sets the visibility of the delete button.

Parameters:
visible - is true if visible, false if not

isDeleteButtonVisible

public boolean isDeleteButtonVisible()
Gets the visibility of the delete button.

Returns:
true if visible, false if not

setDownButtonVisible

public void setDownButtonVisible(boolean visible)
Sets the visibility of the down button.

Parameters:
visible - is true if visible, false if not

isDownButtonVisible

public boolean isDownButtonVisible()
Gets the visibility of the down button.

Returns:
true if visible, false if not

setUpButtonVisible

public void setUpButtonVisible(boolean visible)
Sets the visibility of the up button.

Parameters:
visible - is true if visible, false if not

isUpButtonVisible

public boolean isUpButtonVisible()
Gets the visibility of the up button.

Returns:
true if visible, false if not

setSaveButtonVisible

public void setSaveButtonVisible(boolean visible)
Sets the visibility of the save button.

Parameters:
visible - is true if visible, false if not

isSaveButtonVisible

public boolean isSaveButtonVisible()
Gets the visibility of the save button.

Returns:
true if visible, false if not

setNewButtonVisible

public void setNewButtonVisible(boolean visible)
Sets the visibility of the new button.

Parameters:
visible - is true if visible, false if not

isNewButtonVisible

public boolean isNewButtonVisible()
Gets the visibility of the save button.

Returns:
true if visible, false if not

setButtonsLessObtrusive

public void setButtonsLessObtrusive(boolean flag)
Makes the buttons less obtrusive. Useful if AppDbObjectTablePanel is embedded in another dialog with buttons.

Parameters:
flag - true for less obstrusive buttons, false is default.

getCancelButton

public FormButton getCancelButton()
Get access to the cancel button.

Returns:
the cancel button

getDeleteButton

public FormButton getDeleteButton()
Get access to the delete button.

Returns:
the delete button

getMoveDownButton

public FormButton getMoveDownButton()
Get access to the move-down button.

Returns:
the move-down button

getMoveUpButton

public FormButton getMoveUpButton()
Get access to the move-up button.

Returns:
the move-up button

getSaveButton

public FormButton getSaveButton()
Get access to the save button.

Returns:
the save button

getNewButton

public FormButton getNewButton()
Get access to the new button.

Returns:
the new button

getButtonsLessObtrusive

public boolean getButtonsLessObtrusive()
Returns:
true if buttons are less obstrusive.

setTemplate

public void setTemplate(FormTableEntry template)
Changes the template (necessary if context changed).

Parameters:
template - the template

getTemplate

public FormTableEntry getTemplate()
Gets the template.

Returns:
the current template

setAllChangeable

public void setAllChangeable(boolean changeable)
Description copied from interface: FormContainer
Sets the changeable attribute of all components of this container and all sub containers.

Specified by:
setAllChangeable in interface FormContainer
Overrides:
setAllChangeable in class FormPanel
Parameters:
changeable - true if all changeable (default)

listChanged

public void listChanged(List<? extends AppDbObject> objList)
Shows a list of data objects.

Parameters:
objList - the list of objects

isDataChanged

public boolean isDataChanged()
Gets status info whether data has been changed or not.

Returns:
true if model data has been changed

getFormTable

public FormTable getFormTable()
Gets the table.

Returns:
the FormTable

addTableModelListener

public void addTableModelListener(TableModelListener l)
Adds a TableModelListener.

Parameters:
l - the listener to add

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Removes a TableModelListener.

Parameters:
l - the listener to remove


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de