org.jminor.framework.client.ui
Class EntityEditPanel

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.jminor.common.ui.valuemap.ValueChangeMapEditPanel<String,Object>
                      extended by org.jminor.framework.client.ui.EntityEditPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ExceptionHandler

public abstract class EntityEditPanel
extends ValueChangeMapEditPanel<String,Object>
implements ExceptionHandler

A UI component based on the EntityEditModel.

See Also:
EntityEditModel, 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 CLEAR
           
static int CONFIRM_TYPE_DELETE
           
static int CONFIRM_TYPE_INSERT
           
static int CONFIRM_TYPE_UPDATE
           
static String DELETE
           
static String INSERT
           
static String REFRESH
           
static String UPDATE
           
 
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
EntityEditPanel(EntityEditModel editModel)
          Instantiates a new EntityEditPanel based on the provided EntityEditModel
EntityEditPanel(EntityEditModel editModel, String... controlKeys)
          Instantiates a new EntityEditPanel based on the provided EntityEditModel
 
Method Summary
protected  void addPropertyPanel(String propertyID)
          Adds a property panel for the given property to this panel
protected  boolean confirm(String message, String title)
          Presents a OK/Cancel confirm dialog with the given message and title, returns true if OK was selected.
protected  boolean confirmDelete()
          Called before a delete is performed, if true is returned the delete action is performed otherwise it is cancelled
protected  boolean confirmInsert()
          Called before a insert is performed, the default implementation simply returns true
protected  boolean confirmUpdate()
          Called before an update is performed, if true is returned the update action is performed otherwise it is cancelled
protected  JComboBox createBooleanComboBox(Property property)
          Create a JComboBox for the given property, containing values for the boolean values: true, false, null
protected  JComboBox createBooleanComboBox(Property property, StateObserver enabledState)
          Create a JComboBox for the given property, containing values for the boolean values: true, false, null
protected  JComboBox createBooleanComboBox(String propertyID)
          Create a JComboBox for the property identified by propertyID, containing values for the boolean values: true, false, null
protected  JComboBox createBooleanComboBox(String propertyID, StateObserver enabledState)
          Create a JComboBox for the property identified by propertyID, containing values for the boolean values: true, false, null
protected  JCheckBox createCheckBox(Property property)
          Creates a JCheckBox bound to the given property
protected  JCheckBox createCheckBox(Property property, StateObserver enabledState)
          Creates a JCheckBox bound to the given property
protected  JCheckBox createCheckBox(Property property, StateObserver enabledState, boolean includeCaption)
          Creates a JCheckBox bound to the given property
protected  JCheckBox createCheckBox(String propertyID)
          Creates a JCheckBox bound to the property identified by propertyID
protected  JCheckBox createCheckBox(String propertyID, StateObserver enabledState)
          Creates a JCheckBox bound to the property identified by propertyID
protected  JCheckBox createCheckBox(String propertyID, StateObserver enabledState, boolean includeCaption)
          Creates a JCheckBox bound to the property identified by propertyID
protected  SteppedComboBox createComboBox(Property property, ComboBoxModel comboBoxModel, boolean maximumMatch)
          Creates a SteppedComboBox bound to the given property
protected  SteppedComboBox createComboBox(Property property, ComboBoxModel comboBoxModel, boolean maximumMatch, StateObserver enabledState)
          Creates a SteppedComboBox bound to the given property
protected  SteppedComboBox createComboBox(String propertyID, ComboBoxModel comboBoxModel, boolean maximumMatch)
          Creates a SteppedComboBox bound to the property identified by propertyID
protected  SteppedComboBox createComboBox(String propertyID, ComboBoxModel comboBoxModel, boolean maximumMatch, StateObserver enabledState)
          Creates a SteppedComboBox bound to the property identified by propertyID
 JPanel createControlPanel(boolean horizontal)
          Initializes the control panel, that is, the panel containing buttons for editing entities (Insert, Update...)
protected  DateInputPanel createDateInputPanel(Property property)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState, LinkType linkType)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID)
          Creates a new DateInputPanel using the default short date format, bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID, boolean includeButton)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState, LinkType linkType)
          Creates a new DateInputPanel bound to the property identified by propertyID.
protected  SteppedComboBox createEditableComboBox(Property property, ComboBoxModel comboBoxModel, StateObserver enabledState)
          Creates an editable SteppedComboBox bound to the given property
protected  SteppedComboBox createEditableComboBox(String propertyID, ComboBoxModel comboBoxModel)
          Creates an editable SteppedComboBox bound to the property identified by propertyID
protected  SteppedComboBox createEditableComboBox(String propertyID, ComboBoxModel comboBoxModel, StateObserver enabledState)
          Creates an editable SteppedComboBox bound to the property identified by propertyID
protected  EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty)
          Creates an EntityComboBox bound to the given foreign key property
protected  EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty, StateObserver enabledState)
          Creates an EntityComboBox bound to the given foreign key property
protected  EntityComboBox createEntityComboBox(String foreignKeyPropertyID)
          Creates an EntityComboBox bound to the property identified by propertyID
protected  EntityComboBox createEntityComboBox(String foreignKeyPropertyID, StateObserver enabledState)
          Creates a EntityComboBox bound to the property identified by propertyID
protected  JTextField createEntityField(Property.ForeignKeyProperty foreignKeyProperty)
          Creates an uneditable JTextField bound to the given property
protected  JTextField createEntityField(String propertyID)
          Creates an uneditable JTextField bound to the property identified by propertyID
protected  EntityUiUtil.EntityFieldPanel createEntityFieldPanel(Property.ForeignKeyProperty foreignKeyProperty, EntityTableModel lookupModel)
          Creates a JPanel containing an uneditable JTextField bound to the given property identified and a button for selecting an Entity to set as the property value
protected  JPanel createEntityFieldPanel(String propertyID, EntityTableModel lookupModel)
          Creates a JPanel containing an uneditable JTextField bound to the property identified by propertyID and a button for selecting an Entity to set as the property value
protected  EntityLookupField createEntityLookupField(Property.ForeignKeyProperty foreignKeyProperty, String... searchPropertyIDs)
          Creates an EntityLookupField bound to the given foreign key property
protected  EntityLookupField createEntityLookupField(String foreignKeyPropertyID)
          Creates an EntityLookupField bound to the property identified by propertyID, the property must be an Property.ForeignKeyProperty
protected  EntityLookupField createEntityLookupField(String foreignKeyPropertyID, String... searchPropertyIDs)
          Creates an EntityLookupField bound to the property identified by propertyID, the property must be an Property.ForeignKeyProperty
protected  JLabel createLabel(String propertyID)
          Creates a JLabel with a caption from the property identified by propertyID
protected  JLabel createLabel(String propertyID, int horizontalAlignment)
          Creates a JLabel with a caption from the given property identified by propertyID
protected  SteppedComboBox createPropertyComboBox(Property.ColumnProperty property)
          Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState)
          Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState, String nullValueString)
          Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState, String nullValueString, boolean editable)
          Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(String propertyID)
          Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState)
          Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState, String nullValueString)
          Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property
protected  SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState, String nullValueString, boolean editable)
          Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property
protected  JPanel createPropertyPanel(JComponent labelComponent, JComponent inputComponent, boolean labelOnTop)
          Creates a panel containing a label component and the inputComponent.
protected  JPanel createPropertyPanel(JComponent labelComponent, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap)
          Creates a panel containing a label component and the inputComponent.
protected  JPanel createPropertyPanel(String propertyID)
          Creates a panel containing a label and the component associated with the given property.
protected  JPanel createPropertyPanel(String propertyID, JComponent inputComponent)
          Creates a panel containing a label and the given component.
protected  JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop)
          Creates a panel containing a label and the given component.
protected  JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap)
          Creates a panel containing a label and the given component.
protected  JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap, int labelAlignment)
          Creates a panel containing a label and the given component.
protected  JTextArea createTextArea(String propertyID)
          Creates a JTextArea component bound to the property identified by propertyID .
protected  JTextArea createTextArea(String propertyID, int rows, int columns)
          Creates a JTextArea component bound to the property identified by propertyID .
protected  JTextArea createTextArea(String propertyID, LinkType linkType, int rows, int columns)
          Creates a JTextArea component bound to the property identified by propertyID .
protected  JTextField createTextField(Property property)
          Creates a JTextField bound to the given property
protected  JTextField createTextField(Property property, LinkType linkType)
          Creates a JTextField bound to the given property
protected  JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate)
          Creates a JTextField bound to the given property
protected  JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate, StateObserver enabledState)
          Creates a JTextField bound to the given property
protected  JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate, StateObserver enabledState, boolean valueIncludesLiteralCharacters)
          Creates a JTextField bound to the given property
protected  JTextField createTextField(String propertyID)
          Creates a JTextField bound to the property identified by propertyID
protected  JTextField createTextField(String propertyID, LinkType linkType)
          Creates a JTextField bound to the property identified by propertyID
protected  JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate)
          Creates a JTextField bound to the property identified by propertyID
protected  JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString)
          Creates a JTextField bound to the property identified by propertyID
protected  JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString, StateObserver enabledState)
          Creates a JTextField bound to the property identified by propertyID
protected  JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString, StateObserver enabledState, boolean valueIncludesLiteralCharacters)
          Creates a JTextField bound to the property identified by propertyID
protected  TextInputPanel createTextInputPanel(Property property, LinkType linkType, boolean immediateUpdate)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TextInputPanel createTextInputPanel(Property property, LinkType linkType, boolean immediateUpdate, boolean buttonFocusable)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TextInputPanel createTextInputPanel(String propertyID)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TextInputPanel createTextInputPanel(String propertyID, LinkType linkType)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TextInputPanel createTextInputPanel(String propertyID, LinkType linkType, boolean immediateUpdate)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TextInputPanel createTextInputPanel(String propertyID, LinkType linkType, boolean immediateUpdate, boolean buttonFocusable)
          Creates a TextInputPanel bound to the property identified by propertyID.
protected  TristateCheckBox createTristateCheckBox(Property property)
          Creates a TristateCheckBox bound to the given property
protected  TristateCheckBox createTristateCheckBox(Property property, StateObserver enabledState)
          Creates a TristateCheckBox bound to the given property
protected  TristateCheckBox createTristateCheckBox(Property property, StateObserver enabledState, boolean includeCaption)
          Creates a TristateCheckBox bound to the given property
protected  TristateCheckBox createTristateCheckBox(String propertyID)
          Creates a TristateCheckBox bound to the property identified by propertyID
protected  TristateCheckBox createTristateCheckBox(String propertyID, StateObserver enabledState)
          Creates a TristateCheckBox bound to the property identified by propertyID
protected  TristateCheckBox createTristateCheckBox(String propertyID, StateObserver enabledState, boolean includeCaption)
          Creates a TristateCheckBox bound to the property identified by propertyID
protected  SteppedComboBox createValueListComboBox(Property.ValueListProperty property)
          Creates a SteppedComboBox containing the values defined in the given value list property, bound to the given property.
protected  SteppedComboBox createValueListComboBox(Property.ValueListProperty property, StateObserver enabledState)
          Creates a SteppedComboBox containing the values defined in the given value list property, bound to the given property.
protected  SteppedComboBox createValueListComboBox(String propertyID)
          Creates a SteppedComboBox containing the values defined by the given value list property, bound to the given property.
protected  SteppedComboBox createValueListComboBox(String propertyID, StateObserver enabledState)
          Creates a SteppedComboBox containing the values defined by the given value list property, bound to the given property.
 boolean delete()
          Performs a delete on the active entity
 boolean delete(boolean confirm)
          Performs a delete on the active entity
 StateObserver getActiveState()
          Indicates whether this panel is active and ready to receive input
 Control getClearControl()
           
protected  String[] getConfirmationMessages(int type)
           
 Control getControl(String controlCode)
           
 JToolBar getControlToolBar(int orientation)
          Initializes the control toolbar, that is, the toolbar containing buttons for editing entities (Insert, Update...)
 Control getDeleteControl()
           
 EntityEditModel getEntityEditModel()
           
 Control getInsertControl()
           
 Control getRefreshControl()
           
 Control getSaveControl()
           
 Control getUpdateControl()
           
 void handleException(Throwable throwable)
          Handles the given exception, which usually means simply displaying it to the user
 void handleException(Throwable exception, JComponent dialogParent)
          Handles the given exception
 EntityEditPanel initializePanel()
          Initializes this EntityEditPanel UI.
protected abstract  void initializeUI()
          Initializes this EntityEditPanel UI
 boolean insert()
          Performs a insert on the active entity
 boolean insert(boolean confirm)
          Performs a insert on the active entity
 boolean isActive()
           
 boolean isPanelInitialized()
           
 void save()
          Saves the active entity, that is, if no entity is selected it performs a insert otherwise the user is asked whether to update the selected entity or insert a new one
 void setActive(boolean active)
          Sets the active state of this edit panel, an active edit panel should be enabled and ready to receive input
protected  void setControl(String controlCode, Control control)
          Associates control with controlCode
 String toString()
           
 boolean update()
          Performs an update on the active entity
 boolean update(boolean confirm)
          Performs an update on the active entity
protected  void validateData()
          for overriding, called before insert/update
 
Methods inherited from class org.jminor.common.ui.valuemap.ValueChangeMapEditPanel
clearModelValues, getComponent, getComponentKey, getComponentKeys, getEditModel, getInitialFocusComponent, getInitialFocusComponentKey, prepareUI, selectComponent, setComponent, setInitialFocus, setInitialFocusComponent, setInitialFocusComponentKey
 
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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIRM_TYPE_INSERT

public static final int CONFIRM_TYPE_INSERT
See Also:
Constant Field Values

CONFIRM_TYPE_UPDATE

public static final int CONFIRM_TYPE_UPDATE
See Also:
Constant Field Values

CONFIRM_TYPE_DELETE

public static final int CONFIRM_TYPE_DELETE
See Also:
Constant Field Values

INSERT

public static final String INSERT
See Also:
Constant Field Values

UPDATE

public static final String UPDATE
See Also:
Constant Field Values

DELETE

public static final String DELETE
See Also:
Constant Field Values

REFRESH

public static final String REFRESH
See Also:
Constant Field Values

CLEAR

public static final String CLEAR
See Also:
Constant Field Values
Constructor Detail

EntityEditPanel

public EntityEditPanel(EntityEditModel editModel)
Instantiates a new EntityEditPanel based on the provided EntityEditModel

Parameters:
editModel - the EntityEditModel instance to base this EntityEditPanel on

EntityEditPanel

public EntityEditPanel(EntityEditModel editModel,
                       String... controlKeys)
Instantiates a new EntityEditPanel based on the provided EntityEditModel

Parameters:
editModel - the EntityEditModel instance to base this EntityEditPanel on
controlKeys - if specified only controls with those keys are initialized
Method Detail

toString

public final String toString()
Overrides:
toString in class Component

getEntityEditModel

public final EntityEditModel getEntityEditModel()
Returns:
the edit model this panel is based on

getActiveState

public final StateObserver getActiveState()
Indicates whether this panel is active and ready to receive input

Returns:
a state indicating whether the active is active and ready to receive input

setActive

public final void setActive(boolean active)
Sets the active state of this edit panel, an active edit panel should be enabled and ready to receive input

Parameters:
active - the active state

isActive

public final boolean isActive()
Returns:
true if this edit panel is active and ready to receive input

getControl

public final Control getControl(String controlCode)
Parameters:
controlCode - the control code
Returns:
the control associated with controlCode
Throws:
RuntimeException - in case no control is associated with the given control code

getRefreshControl

public final Control getRefreshControl()
Returns:
a control for refreshing the model data

getDeleteControl

public final Control getDeleteControl()
Returns:
a control for deleting the active entity

getClearControl

public final Control getClearControl()
Returns:
a control for clearing the UI controls

getUpdateControl

public final Control getUpdateControl()
Returns:
a control for performing an update on the active entity

getInsertControl

public final Control getInsertControl()
Returns:
a control for performing an insert on the active entity

getSaveControl

public final Control getSaveControl()
Returns:
a control for performing a save on the active entity

handleException

public final void handleException(Throwable throwable)
Handles the given exception, which usually means simply displaying it to the user

Parameters:
throwable - the exception to handle

handleException

public final void handleException(Throwable exception,
                                  JComponent dialogParent)
Handles the given exception

Specified by:
handleException in interface ExceptionHandler
Parameters:
exception - the exception to handle
dialogParent - the component to use as exception dialog parent

createControlPanel

public final JPanel createControlPanel(boolean horizontal)
Initializes the control panel, that is, the panel containing buttons for editing entities (Insert, Update...)

Parameters:
horizontal - true if the buttons should be layed out horizontally, false otherwise
Returns:
the control panel

getControlToolBar

public final JToolBar getControlToolBar(int orientation)
Initializes the control toolbar, that is, the toolbar containing buttons for editing entities (Insert, Update...)

Parameters:
orientation - the orientation
Returns:
the control toolbar

initializePanel

public final EntityEditPanel initializePanel()
Initializes this EntityEditPanel UI. This method marks this panel as initialized which prevents it from running again, whether or not an exception occurs.

Returns:
this EntityPanel instance
See Also:
isPanelInitialized()

isPanelInitialized

public final boolean isPanelInitialized()
Returns:
true if the method initializePanel() has been called on this EntityEditPanel instance
See Also:
initializePanel()

save

public final void save()
Saves the active entity, that is, if no entity is selected it performs a insert otherwise the user is asked whether to update the selected entity or insert a new one


insert

public final boolean insert()
Performs a insert on the active entity

Returns:
true in case of successful insert, false otherwise

insert

public final boolean insert(boolean confirm)
Performs a insert on the active entity

Parameters:
confirm - if true then confirmInsert() is called
Returns:
true in case of successful insert, false otherwise

delete

public final boolean delete()
Performs a delete on the active entity

Returns:
true if the delete operation was successful

delete

public final boolean delete(boolean confirm)
Performs a delete on the active entity

Parameters:
confirm - if true then confirmDelete() is called
Returns:
true if the delete operation was successful

update

public final boolean update()
Performs an update on the active entity

Returns:
true if the update operation was successful

update

public final boolean update(boolean confirm)
Performs an update on the active entity

Parameters:
confirm - if true then confirmUpdate() is called
Returns:
true if the update operation was successful

validateData

protected void validateData()
                     throws ValidationException,
                            CancelException
for overriding, called before insert/update

Throws:
ValidationException - in case of a validation failure
CancelException - in case the user cancels the action during validation

confirmInsert

protected boolean confirmInsert()
Called before a insert is performed, the default implementation simply returns true

Returns:
true if a insert should be performed, false if it should be vetoed

confirmDelete

protected boolean confirmDelete()
Called before a delete is performed, if true is returned the delete action is performed otherwise it is cancelled

Returns:
true if the delete action should be performed

confirmUpdate

protected boolean confirmUpdate()
Called before an update is performed, if true is returned the update action is performed otherwise it is cancelled

Returns:
true if the update action should be performed

confirm

protected boolean confirm(String message,
                          String title)
Presents a OK/Cancel confirm dialog with the given message and title, returns true if OK was selected.

Parameters:
message - the message
title - the dialog title
Returns:
true if OK was selected

getConfirmationMessages

protected String[] getConfirmationMessages(int type)
Parameters:
type - the confirmation message type, one of the following: EntityEditPanel.CONFIRM_TYPE_INSERT, EntityEditPanel.CONFIRM_TYPE_DELETE or EntityEditPanel.CONFIRM_TYPE_UPDATE
Returns:
a string array containing two elements, the element at index 0 is used as the message displayed in the dialog and the element at index 1 is used as the dialog title, i.e. ["Are you sure you want to delete the selected records?", "About to delete selected records"]

setControl

protected final void setControl(String controlCode,
                                Control control)
Associates control with controlCode

Parameters:
controlCode - the control code
control - the control to associate with controlCode

initializeUI

protected abstract void initializeUI()
Initializes this EntityEditPanel UI


addPropertyPanel

protected final void addPropertyPanel(String propertyID)
Adds a property panel for the given property to this panel

Parameters:
propertyID - the ID of the property
See Also:
createPropertyPanel(String)

createPropertyPanel

protected final JPanel createPropertyPanel(String propertyID)
Creates a panel containing a label and the component associated with the given property. The label text is the caption of the property identified by propertyID. The default layout of the resulting panel is with the label on top and inputComponent below.

Parameters:
propertyID - the id of the property from which to retrieve the label caption
Returns:
a panel containing a label and a component
Throws:
IllegalArgumentException - in case no component has been associated with the given property

createPropertyPanel

protected final JPanel createPropertyPanel(String propertyID,
                                           JComponent inputComponent)
Creates a panel containing a label and the given component. The label text is the caption of the property identified by propertyID. The default layout of the resulting panel is with the label on top and inputComponent below.

Parameters:
propertyID - the id of the property from which to retrieve the label caption
inputComponent - a component bound to the property with id propertyID
Returns:
a panel containing a label and a component

createPropertyPanel

protected final JPanel createPropertyPanel(String propertyID,
                                           JComponent inputComponent,
                                           boolean labelOnTop)
Creates a panel containing a label and the given component. The label text is the caption of the property identified by propertyID.

Parameters:
propertyID - the id of the property from which to retrieve the label caption
inputComponent - a component bound to the property with id propertyID
labelOnTop - if true then the label is positioned above inputComponent, otherwise it uses FlowLayout.LEADING in a FlowLayout.
Returns:
a panel containing a label and a component

createPropertyPanel

protected final JPanel createPropertyPanel(String propertyID,
                                           JComponent inputComponent,
                                           boolean labelOnTop,
                                           int hgap,
                                           int vgap)
Creates a panel containing a label and the given component. The label text is the caption of the property identified by propertyID.

Parameters:
propertyID - the id of the property from which to retrieve the label caption
inputComponent - a component bound to the property with id propertyID
labelOnTop - if true then the label is positioned above inputComponent, otherwise it uses FlowLayout.LEADING in a FlowLayout.
hgap - the horizontal gap between components
vgap - the vertical gap between components
Returns:
a panel containing a label and a component

createPropertyPanel

protected final JPanel createPropertyPanel(String propertyID,
                                           JComponent inputComponent,
                                           boolean labelOnTop,
                                           int hgap,
                                           int vgap,
                                           int labelAlignment)
Creates a panel containing a label and the given component. The label text is the caption of the property identified by propertyID.

Parameters:
propertyID - the id of the property from which to retrieve the label caption
inputComponent - a component bound to the property with id propertyID
labelOnTop - if true then the label is positioned above inputComponent, otherwise it uses FlowLayout.LEADING in a FlowLayout.
hgap - the horizontal gap between components
vgap - the vertical gap between components
labelAlignment - the text alignment to use for the label
Returns:
a panel containing a label and a component

createPropertyPanel

protected final JPanel createPropertyPanel(JComponent labelComponent,
                                           JComponent inputComponent,
                                           boolean labelOnTop)
Creates a panel containing a label component and the inputComponent.

Parameters:
labelComponent - the label component
inputComponent - a component bound to the property with id propertyID
labelOnTop - if true then the label is positioned above inputComponent, otherwise it uses FlowLayout.LEADING in a FlowLayout.
Returns:
a panel containing a label and a component

createPropertyPanel

protected final JPanel createPropertyPanel(JComponent labelComponent,
                                           JComponent inputComponent,
                                           boolean labelOnTop,
                                           int hgap,
                                           int vgap)
Creates a panel containing a label component and the inputComponent.

Parameters:
labelComponent - the label component
inputComponent - a component bound to the property with id propertyID
labelOnTop - if true then the label is positioned above inputComponent, otherwise it uses FlowLayout.LEADING in a FlowLayout.
hgap - the horizontal gap between components
vgap - the vertical gap between components
Returns:
a panel containing a label and a component

createTextArea

protected final JTextArea createTextArea(String propertyID)
Creates a JTextArea component bound to the property identified by propertyID .

Parameters:
propertyID - the ID of the property to bind
Returns:
a JTextArea bound to the property

createTextArea

protected final JTextArea createTextArea(String propertyID,
                                         int rows,
                                         int columns)
Creates a JTextArea component bound to the property identified by propertyID .

Parameters:
propertyID - the ID of the property to bind
rows - the number of rows in the text area
columns - the number of columns in the text area
Returns:
a JTextArea bound to the property

createTextArea

protected final JTextArea createTextArea(String propertyID,
                                         LinkType linkType,
                                         int rows,
                                         int columns)
Creates a JTextArea component bound to the property identified by propertyID .

Parameters:
propertyID - the ID of the property to bind
linkType - the link type
rows - the number of rows in the text area
columns - the number of columns in the text area
Returns:
a JTextArea bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(String propertyID)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property to bind
Returns:
a TextInputPanel bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(String propertyID,
                                                    LinkType linkType)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
Returns:
a TextInputPanel bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(String propertyID,
                                                    LinkType linkType,
                                                    boolean immediateUpdate)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property to bind
linkType - the property LinkType
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
Returns:
a TextInputPanel bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(String propertyID,
                                                    LinkType linkType,
                                                    boolean immediateUpdate,
                                                    boolean buttonFocusable)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
buttonFocusable - specifies whether the edit button should be focusable.
Returns:
a TextInputPanel bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(Property property,
                                                    LinkType linkType,
                                                    boolean immediateUpdate)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
property - the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
Returns:
a TextInputPanel bound to the property

createTextInputPanel

protected final TextInputPanel createTextInputPanel(Property property,
                                                    LinkType linkType,
                                                    boolean immediateUpdate,
                                                    boolean buttonFocusable)
Creates a TextInputPanel bound to the property identified by propertyID.

Parameters:
property - the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
buttonFocusable - specifies whether the edit button should be focusable.
Returns:
a TextInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID)
Creates a new DateInputPanel using the default short date format, bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
Returns:
a DateInputPanel using the default short date format
See Also:
Configuration.DEFAULT_DATE_FORMAT

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID,
                                                    SimpleDateFormat dateFormat)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
dateFormat - the format to use for masking the input field
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID,
                                                    boolean includeButton)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
includeButton - if true a button for visually editing the date is included
Returns:
a DateInputPanel using the default short date format
See Also:
Configuration.DEFAULT_DATE_FORMAT

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton,
                                                    StateObserver enabledState)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
enabledState - a state for controlling the enabled state of the input component
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(String propertyID,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton,
                                                    StateObserver enabledState,
                                                    LinkType linkType)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
propertyID - the ID of the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
enabledState - a state for controlling the enabled state of the input component
linkType - the property link type
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(Property property)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
property - the property for which to create the panel
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(Property property,
                                                    SimpleDateFormat dateFormat)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
property - the property for which to create the panel
dateFormat - the format to use for masking the input field
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(Property property,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
property - the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(Property property,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton,
                                                    StateObserver enabledState)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
property - the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
enabledState - a state for controlling the enabled state of the input component
Returns:
a DateInputPanel bound to the property

createDateInputPanel

protected final DateInputPanel createDateInputPanel(Property property,
                                                    SimpleDateFormat dateFormat,
                                                    boolean includeButton,
                                                    StateObserver enabledState,
                                                    LinkType linkType)
Creates a new DateInputPanel bound to the property identified by propertyID.

Parameters:
property - the property for which to create the panel
dateFormat - the format to use for masking the input field
includeButton - if true a button for visually editing the date is included
enabledState - a state for controlling the enabled state of the input component
linkType - the property link type
Returns:
a DateInputPanel bound to the property

createTextField

protected final JTextField createTextField(String propertyID)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(String propertyID,
                                           LinkType linkType)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(String propertyID,
                                           LinkType linkType,
                                           boolean immediateUpdate)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(String propertyID,
                                           LinkType linkType,
                                           boolean immediateUpdate,
                                           String maskString)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(String propertyID,
                                           LinkType linkType,
                                           boolean immediateUpdate,
                                           String maskString,
                                           StateObserver enabledState)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
enabledState - a state for controlling the enabled state of the component
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(String propertyID,
                                           LinkType linkType,
                                           boolean immediateUpdate,
                                           String maskString,
                                           StateObserver enabledState,
                                           boolean valueIncludesLiteralCharacters)
Creates a JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
enabledState - a state for controlling the enabled state of the component
valueIncludesLiteralCharacters - only applicable if maskString is specified
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(Property property)
Creates a JTextField bound to the given property

Parameters:
property - the property to bind
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(Property property,
                                           LinkType linkType)
Creates a JTextField bound to the given property

Parameters:
property - the property to bind
linkType - the property link type
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(Property property,
                                           LinkType linkType,
                                           String maskString,
                                           boolean immediateUpdate)
Creates a JTextField bound to the given property

Parameters:
property - the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(Property property,
                                           LinkType linkType,
                                           String maskString,
                                           boolean immediateUpdate,
                                           StateObserver enabledState)
Creates a JTextField bound to the given property

Parameters:
property - the ID of the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
enabledState - a state for controlling the enabled state of the component
Returns:
a text field bound to the property

createTextField

protected final JTextField createTextField(Property property,
                                           LinkType linkType,
                                           String maskString,
                                           boolean immediateUpdate,
                                           StateObserver enabledState,
                                           boolean valueIncludesLiteralCharacters)
Creates a JTextField bound to the given property

Parameters:
property - the property to bind
linkType - the property link type
immediateUpdate - if true then the underlying property value is updated on each keystroke, otherwise it is updated when the component looses focus.
maskString - if specified then a JFormattedTextField with the given mask is returned
enabledState - a state for controlling the enabled state of the component
valueIncludesLiteralCharacters - only applicable if maskString is specified
Returns:
a text field bound to the property

createCheckBox

protected final JCheckBox createCheckBox(String propertyID)
Creates a JCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
Returns:
a JCheckBox bound to the property

createCheckBox

protected final JCheckBox createCheckBox(String propertyID,
                                         StateObserver enabledState)
Creates a JCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a JCheckBox bound to the property

createCheckBox

protected final JCheckBox createCheckBox(String propertyID,
                                         StateObserver enabledState,
                                         boolean includeCaption)
Creates a JCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
includeCaption - specifies whether or not the caption should be included
Returns:
a JCheckBox bound to the property

createCheckBox

protected final JCheckBox createCheckBox(Property property)
Creates a JCheckBox bound to the given property

Parameters:
property - the property to bind
Returns:
a JCheckBox bound to the property

createCheckBox

protected final JCheckBox createCheckBox(Property property,
                                         StateObserver enabledState)
Creates a JCheckBox bound to the given property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a JCheckBox bound to the property

createCheckBox

protected final JCheckBox createCheckBox(Property property,
                                         StateObserver enabledState,
                                         boolean includeCaption)
Creates a JCheckBox bound to the given property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
includeCaption - specifies whether or not the caption should be included
Returns:
a JCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(String propertyID)
Creates a TristateCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
Returns:
a TristateCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(String propertyID,
                                                        StateObserver enabledState)
Creates a TristateCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a TristateCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(String propertyID,
                                                        StateObserver enabledState,
                                                        boolean includeCaption)
Creates a TristateCheckBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
includeCaption - specifies whether or not the caption should be included
Returns:
a TristateCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(Property property)
Creates a TristateCheckBox bound to the given property

Parameters:
property - the property to bind
Returns:
a TristateCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(Property property,
                                                        StateObserver enabledState)
Creates a TristateCheckBox bound to the given property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a TristateCheckBox bound to the property

createTristateCheckBox

protected final TristateCheckBox createTristateCheckBox(Property property,
                                                        StateObserver enabledState,
                                                        boolean includeCaption)
Creates a TristateCheckBox bound to the given property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
includeCaption - specifies whether or not the caption should be included
Returns:
a TristateCheckBox bound to the property

createBooleanComboBox

protected final JComboBox createBooleanComboBox(String propertyID)
Create a JComboBox for the property identified by propertyID, containing values for the boolean values: true, false, null

Parameters:
propertyID - the ID of the property to bind
Returns:
JComboBox for the given property

createBooleanComboBox

protected final JComboBox createBooleanComboBox(String propertyID,
                                                StateObserver enabledState)
Create a JComboBox for the property identified by propertyID, containing values for the boolean values: true, false, null

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
JComboBox for the given property

createBooleanComboBox

protected final JComboBox createBooleanComboBox(Property property)
Create a JComboBox for the given property, containing values for the boolean values: true, false, null

Parameters:
property - the property to bind
Returns:
JComboBox for the given property

createBooleanComboBox

protected final JComboBox createBooleanComboBox(Property property,
                                                StateObserver enabledState)
Create a JComboBox for the given property, containing values for the boolean values: true, false, null

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
JComboBox for the given property

createComboBox

protected final SteppedComboBox createComboBox(String propertyID,
                                               ComboBoxModel comboBoxModel,
                                               boolean maximumMatch)
Creates a SteppedComboBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
comboBoxModel - the ComboBoxModel
maximumMatch - true if maximum match should be used
Returns:
a SteppedComboBox bound the the property
See Also:
MaximumMatch

createComboBox

protected final SteppedComboBox createComboBox(String propertyID,
                                               ComboBoxModel comboBoxModel,
                                               boolean maximumMatch,
                                               StateObserver enabledState)
Creates a SteppedComboBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
comboBoxModel - the ComboBoxModel
maximumMatch - true if maximum match should be used
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound the the property
See Also:
MaximumMatch

createComboBox

protected final SteppedComboBox createComboBox(Property property,
                                               ComboBoxModel comboBoxModel,
                                               boolean maximumMatch)
Creates a SteppedComboBox bound to the given property

Parameters:
property - the property to bind
comboBoxModel - the ComboBoxModel
maximumMatch - true if maximum match should be used
Returns:
a SteppedComboBox bound the the property
See Also:
MaximumMatch

createComboBox

protected final SteppedComboBox createComboBox(Property property,
                                               ComboBoxModel comboBoxModel,
                                               boolean maximumMatch,
                                               StateObserver enabledState)
Creates a SteppedComboBox bound to the given property

Parameters:
property - the property to bind
comboBoxModel - the ComboBoxModel
maximumMatch - true if maximum match should be used
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound the the property
See Also:
MaximumMatch

createValueListComboBox

protected final SteppedComboBox createValueListComboBox(String propertyID)
Creates a SteppedComboBox containing the values defined by the given value list property, bound to the given property.

Parameters:
propertyID - the propertyID
Returns:
a SteppedComboBox bound to the property
Throws:
IllegalArgumentException - in case the property is not a value list property

createValueListComboBox

protected final SteppedComboBox createValueListComboBox(String propertyID,
                                                        StateObserver enabledState)
Creates a SteppedComboBox containing the values defined by the given value list property, bound to the given property.

Parameters:
propertyID - the propertyID
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound to the property
Throws:
IllegalArgumentException - in case the property is not a value list property

createValueListComboBox

protected final SteppedComboBox createValueListComboBox(Property.ValueListProperty property)
Creates a SteppedComboBox containing the values defined in the given value list property, bound to the given property.

Parameters:
property - the property
Returns:
a SteppedComboBox bound to the property

createValueListComboBox

protected final SteppedComboBox createValueListComboBox(Property.ValueListProperty property,
                                                        StateObserver enabledState)
Creates a SteppedComboBox containing the values defined in the given value list property, bound to the given property.

Parameters:
property - the property
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound to the property

createEditableComboBox

protected final SteppedComboBox createEditableComboBox(String propertyID,
                                                       ComboBoxModel comboBoxModel)
Creates an editable SteppedComboBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
comboBoxModel - the ComboBoxModel
Returns:
an editable SteppedComboBox bound the the property

createEditableComboBox

protected final SteppedComboBox createEditableComboBox(String propertyID,
                                                       ComboBoxModel comboBoxModel,
                                                       StateObserver enabledState)
Creates an editable SteppedComboBox bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
comboBoxModel - the ComboBoxModel
enabledState - a state for controlling the enabled state of the component
Returns:
an editable SteppedComboBox bound the the property

createEditableComboBox

protected final SteppedComboBox createEditableComboBox(Property property,
                                                       ComboBoxModel comboBoxModel,
                                                       StateObserver enabledState)
Creates an editable SteppedComboBox bound to the given property

Parameters:
property - the property to bind
comboBoxModel - the ComboBoxModel
enabledState - a state for controlling the enabled state of the component
Returns:
an editable SteppedComboBox bound the the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(String propertyID)
Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property

Parameters:
propertyID - the ID of the property to bind
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(String propertyID,
                                                       StateObserver enabledState)
Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(String propertyID,
                                                       StateObserver enabledState,
                                                       String nullValueString)
Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
nullValueString - the value used to represent a null value, shown at the top of the combo box value list
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(String propertyID,
                                                       StateObserver enabledState,
                                                       String nullValueString,
                                                       boolean editable)
Creates a SteppedComboBox bound to the property identified by propertyID, the combo box contains the underlying values of the property

Parameters:
propertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
nullValueString - the value used to represent a null value, shown at the top of the combo box value list
editable - true if the combo box should be editable, only works with combo boxes based on String.class properties
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property)
Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property

Parameters:
property - the property to bind
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property,
                                                       StateObserver enabledState)
Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property,
                                                       StateObserver enabledState,
                                                       String nullValueString)
Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
nullValueString - the value used to represent a null value, shown at the top of the combo box value list
Returns:
a SteppedComboBox bound to the property

createPropertyComboBox

protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property,
                                                       StateObserver enabledState,
                                                       String nullValueString,
                                                       boolean editable)
Creates a SteppedComboBox bound to the given property, the combo box contains the underlying values of the property

Parameters:
property - the property to bind
enabledState - a state for controlling the enabled state of the component
nullValueString - the value used to represent a null value, shown at the top of the combo box value list
editable - true if the combo box should be editable, only works with combo boxes based on String.class properties
Returns:
a SteppedComboBox bound to the property

createEntityComboBox

protected final EntityComboBox createEntityComboBox(String foreignKeyPropertyID,
                                                    StateObserver enabledState)
Creates a EntityComboBox bound to the property identified by propertyID

Parameters:
foreignKeyPropertyID - the ID of the property to bind
enabledState - a state for controlling the enabled state of the component
Returns:
a EntityComboBox bound to the property

createEntityComboBox

protected final EntityComboBox createEntityComboBox(String foreignKeyPropertyID)
Creates an EntityComboBox bound to the property identified by propertyID

Parameters:
foreignKeyPropertyID - the ID of the foreign key property to bind combination used to create new instances of the entity this EntityComboBox is based on EntityComboBox is focusable
Returns:
an EntityComboBox bound to the property

createEntityComboBox

protected final EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty)
Creates an EntityComboBox bound to the given foreign key property

Parameters:
foreignKeyProperty - the foreign key property to bind
Returns:
an EntityComboBox bound to the property

createEntityComboBox

protected final EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty,
                                                    StateObserver enabledState)
Creates an EntityComboBox bound to the given foreign key property

Parameters:
foreignKeyProperty - the foreign key property to bind combination used to create new instances of the entity this EntityComboBox is based on EntityComboBox is focusable
enabledState - a state for controlling the enabled state of the component
Returns:
an EntityComboBox bound to the property

createEntityLookupField

protected final EntityLookupField createEntityLookupField(String foreignKeyPropertyID)
Creates an EntityLookupField bound to the property identified by propertyID, the property must be an Property.ForeignKeyProperty

Parameters:
foreignKeyPropertyID - the ID of the foreign key property to bind
Returns:
an EntityLookupField bound the property

createEntityLookupField

protected final EntityLookupField createEntityLookupField(String foreignKeyPropertyID,
                                                          String... searchPropertyIDs)
Creates an EntityLookupField bound to the property identified by propertyID, the property must be an Property.ForeignKeyProperty

Parameters:
foreignKeyPropertyID - the ID of the foreign key property to bind
searchPropertyIDs - the IDs of the properties to use in the lookup
Returns:
an EntityLookupField bound the property

createEntityLookupField

protected final EntityLookupField createEntityLookupField(Property.ForeignKeyProperty foreignKeyProperty,
                                                          String... searchPropertyIDs)
Creates an EntityLookupField bound to the given foreign key property

Parameters:
foreignKeyProperty - the foreign key property to bind
searchPropertyIDs - the IDs of the properties to use in the lookup
Returns:
an EntityLookupField bound the property

createEntityField

protected final JTextField createEntityField(String propertyID)
Creates an uneditable JTextField bound to the property identified by propertyID

Parameters:
propertyID - the ID of the property to bind
Returns:
an uneditable JTextField bound to the property

createEntityField

protected final JTextField createEntityField(Property.ForeignKeyProperty foreignKeyProperty)
Creates an uneditable JTextField bound to the given property

Parameters:
foreignKeyProperty - the foreign key property to bind
Returns:
an uneditable JTextField bound to the property

createEntityFieldPanel

protected final JPanel createEntityFieldPanel(String propertyID,
                                              EntityTableModel lookupModel)
Creates a JPanel containing an uneditable JTextField bound to the property identified by propertyID and a button for selecting an Entity to set as the property value

Parameters:
propertyID - the ID of the property to bind
lookupModel - an EntityTableModel to use when looking up entities
Returns:
an uneditable JTextField bound to the property

createEntityFieldPanel

protected final EntityUiUtil.EntityFieldPanel createEntityFieldPanel(Property.ForeignKeyProperty foreignKeyProperty,
                                                                     EntityTableModel lookupModel)
Creates a JPanel containing an uneditable JTextField bound to the given property identified and a button for selecting an Entity to set as the property value

Parameters:
foreignKeyProperty - the foreign key property to bind
lookupModel - an EntityTableModel to use when looking up entities
Returns:
an uneditable JTextField bound to the property

createLabel

protected final JLabel createLabel(String propertyID)
Creates a JLabel with a caption from the property identified by propertyID

Parameters:
propertyID - the ID of the property from which to retrieve the caption
Returns:
a JLabel for the given property

createLabel

protected final JLabel createLabel(String propertyID,
                                   int horizontalAlignment)
Creates a JLabel with a caption from the given property identified by propertyID

Parameters:
propertyID - the ID of the property from which to retrieve the caption
horizontalAlignment - the horizontal text alignment
Returns:
a JLabel for the given property