|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jminor.common.ui.valuemap.ValueChangeMapEditPanel<String,Object>
org.jminor.framework.client.ui.EntityEditPanel
public abstract class EntityEditPanel
A UI component based on the EntityEditModel.
EntityEditModel
,
Serialized FormNested 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONFIRM_TYPE_INSERT
public static final int CONFIRM_TYPE_UPDATE
public static final int CONFIRM_TYPE_DELETE
public static final String INSERT
public static final String UPDATE
public static final String DELETE
public static final String REFRESH
public static final String CLEAR
Constructor Detail |
---|
public EntityEditPanel(EntityEditModel editModel)
editModel
- the EntityEditModel instance to base this EntityEditPanel onpublic EntityEditPanel(EntityEditModel editModel, String... controlKeys)
editModel
- the EntityEditModel instance to base this EntityEditPanel oncontrolKeys
- if specified only controls with those keys are initializedMethod Detail |
---|
public final String toString()
toString
in class Component
public final EntityEditModel getEntityEditModel()
public final StateObserver getActiveState()
public final void setActive(boolean active)
active
- the active statepublic final boolean isActive()
public final Control getControl(String controlCode)
controlCode
- the control code
controlCode
RuntimeException
- in case no control is associated with the given control codepublic final Control getRefreshControl()
public final Control getDeleteControl()
public final Control getClearControl()
public final Control getUpdateControl()
public final Control getInsertControl()
public final Control getSaveControl()
public final void handleException(Throwable throwable)
throwable
- the exception to handlepublic final void handleException(Throwable exception, JComponent dialogParent)
handleException
in interface ExceptionHandler
exception
- the exception to handledialogParent
- the component to use as exception dialog parentpublic final JPanel createControlPanel(boolean horizontal)
horizontal
- true if the buttons should be layed out horizontally, false otherwise
public final JToolBar getControlToolBar(int orientation)
orientation
- the orientation
public final EntityEditPanel initializePanel()
isPanelInitialized()
public final boolean isPanelInitialized()
initializePanel()
public final void save()
public final boolean insert()
public final boolean insert(boolean confirm)
confirm
- if true then confirmInsert() is called
public final boolean delete()
public final boolean delete(boolean confirm)
confirm
- if true then confirmDelete() is called
public final boolean update()
public final boolean update(boolean confirm)
confirm
- if true then confirmUpdate() is called
protected void validateData() throws ValidationException, CancelException
ValidationException
- in case of a validation failure
CancelException
- in case the user cancels the action during validationprotected boolean confirmInsert()
protected boolean confirmDelete()
protected boolean confirmUpdate()
protected boolean confirm(String message, String title)
message
- the messagetitle
- the dialog title
protected String[] getConfirmationMessages(int type)
type
- the confirmation message type, one of the following:
EntityEditPanel.CONFIRM_TYPE_INSERT, EntityEditPanel.CONFIRM_TYPE_DELETE or EntityEditPanel.CONFIRM_TYPE_UPDATE
protected final void setControl(String controlCode, Control control)
control
with controlCode
controlCode
- the control codecontrol
- the control to associate with controlCode
protected abstract void initializeUI()
protected final void addPropertyPanel(String propertyID)
propertyID
- the ID of the propertycreatePropertyPanel(String)
protected final JPanel createPropertyPanel(String propertyID)
propertyID
.
The default layout of the resulting panel is with the label on top and inputComponent below.
propertyID
- the id of the property from which to retrieve the label caption
IllegalArgumentException
- in case no component has been associated with the given propertyprotected final JPanel createPropertyPanel(String propertyID, JComponent inputComponent)
propertyID
.
The default layout of the resulting panel is with the label on top and inputComponent
below.
propertyID
- the id of the property from which to retrieve the label captioninputComponent
- a component bound to the property with id propertyID
protected final JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop)
propertyID
.
propertyID
- the id of the property from which to retrieve the label captioninputComponent
- 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.
protected final JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap)
propertyID
.
propertyID
- the id of the property from which to retrieve the label captioninputComponent
- 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 componentsvgap
- the vertical gap between components
protected final JPanel createPropertyPanel(String propertyID, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap, int labelAlignment)
propertyID
.
propertyID
- the id of the property from which to retrieve the label captioninputComponent
- 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 componentsvgap
- the vertical gap between componentslabelAlignment
- the text alignment to use for the label
protected final JPanel createPropertyPanel(JComponent labelComponent, JComponent inputComponent, boolean labelOnTop)
inputComponent
.
labelComponent
- the label componentinputComponent
- 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.
protected final JPanel createPropertyPanel(JComponent labelComponent, JComponent inputComponent, boolean labelOnTop, int hgap, int vgap)
inputComponent
.
labelComponent
- the label componentinputComponent
- 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 componentsvgap
- the vertical gap between components
protected final JTextArea createTextArea(String propertyID)
propertyID
.
propertyID
- the ID of the property to bind
protected final JTextArea createTextArea(String propertyID, int rows, int columns)
propertyID
.
propertyID
- the ID of the property to bindrows
- the number of rows in the text areacolumns
- the number of columns in the text area
protected final JTextArea createTextArea(String propertyID, LinkType linkType, int rows, int columns)
propertyID
.
propertyID
- the ID of the property to bindlinkType
- the link typerows
- the number of rows in the text areacolumns
- the number of columns in the text area
protected final TextInputPanel createTextInputPanel(String propertyID)
propertyID
.
propertyID
- the ID of the property to bind
protected final TextInputPanel createTextInputPanel(String propertyID, LinkType linkType)
propertyID
.
propertyID
- the ID of the property to bindlinkType
- the property link type
protected final TextInputPanel createTextInputPanel(String propertyID, LinkType linkType, boolean immediateUpdate)
propertyID
.
propertyID
- the ID of the property to bindlinkType
- the property LinkTypeimmediateUpdate
- if true then the underlying property value is updated on each keystroke,
otherwise it is updated when the component looses focus.
protected final TextInputPanel createTextInputPanel(String propertyID, LinkType linkType, boolean immediateUpdate, boolean buttonFocusable)
propertyID
.
propertyID
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- 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.
protected final TextInputPanel createTextInputPanel(Property property, LinkType linkType, boolean immediateUpdate)
propertyID
.
property
- the property to bindlinkType
- the property link typeimmediateUpdate
- if true then the underlying property value is updated on each keystroke,
otherwise it is updated when the component looses focus.
protected final TextInputPanel createTextInputPanel(Property property, LinkType linkType, boolean immediateUpdate, boolean buttonFocusable)
propertyID
.
property
- the property to bindlinkType
- the property link typeimmediateUpdate
- 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.
protected final DateInputPanel createDateInputPanel(String propertyID)
propertyID
.
propertyID
- the ID of the property for which to create the panel
Configuration.DEFAULT_DATE_FORMAT
protected final DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat)
propertyID
.
propertyID
- the ID of the property for which to create the paneldateFormat
- the format to use for masking the input field
protected final DateInputPanel createDateInputPanel(String propertyID, boolean includeButton)
propertyID
.
propertyID
- the ID of the property for which to create the panelincludeButton
- if true a button for visually editing the date is included
Configuration.DEFAULT_DATE_FORMAT
protected final DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton)
propertyID
.
propertyID
- the ID of the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is included
protected final DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState)
propertyID
.
propertyID
- the ID of the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is includedenabledState
- a state for controlling the enabled state of the input component
protected final DateInputPanel createDateInputPanel(String propertyID, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState, LinkType linkType)
propertyID
.
propertyID
- the ID of the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is includedenabledState
- a state for controlling the enabled state of the input componentlinkType
- the property link type
protected final DateInputPanel createDateInputPanel(Property property)
propertyID
.
property
- the property for which to create the panel
protected final DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat)
propertyID
.
property
- the property for which to create the paneldateFormat
- the format to use for masking the input field
protected final DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton)
propertyID
.
property
- the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is included
protected final DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState)
propertyID
.
property
- the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is includedenabledState
- a state for controlling the enabled state of the input component
protected final DateInputPanel createDateInputPanel(Property property, SimpleDateFormat dateFormat, boolean includeButton, StateObserver enabledState, LinkType linkType)
propertyID
.
property
- the property for which to create the paneldateFormat
- the format to use for masking the input fieldincludeButton
- if true a button for visually editing the date is includedenabledState
- a state for controlling the enabled state of the input componentlinkType
- the property link type
protected final JTextField createTextField(String propertyID)
propertyID
propertyID
- the ID of the property to bind
protected final JTextField createTextField(String propertyID, LinkType linkType)
propertyID
propertyID
- the ID of the property to bindlinkType
- the property link type
protected final JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate)
propertyID
propertyID
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- if true then the underlying property value is updated on each keystroke,
otherwise it is updated when the component looses focus.
protected final JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString)
propertyID
propertyID
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- 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
protected final JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString, StateObserver enabledState)
propertyID
propertyID
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- 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 returnedenabledState
- a state for controlling the enabled state of the component
protected final JTextField createTextField(String propertyID, LinkType linkType, boolean immediateUpdate, String maskString, StateObserver enabledState, boolean valueIncludesLiteralCharacters)
propertyID
propertyID
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- 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 returnedenabledState
- a state for controlling the enabled state of the componentvalueIncludesLiteralCharacters
- only applicable if maskString
is specified
protected final JTextField createTextField(Property property)
property
- the property to bind
protected final JTextField createTextField(Property property, LinkType linkType)
property
- the property to bindlinkType
- the property link type
protected final JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate)
property
- the property to bindlinkType
- the property link typeimmediateUpdate
- 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
protected final JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate, StateObserver enabledState)
property
- the ID of the property to bindlinkType
- the property link typeimmediateUpdate
- 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 returnedenabledState
- a state for controlling the enabled state of the component
protected final JTextField createTextField(Property property, LinkType linkType, String maskString, boolean immediateUpdate, StateObserver enabledState, boolean valueIncludesLiteralCharacters)
property
- the property to bindlinkType
- the property link typeimmediateUpdate
- 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 returnedenabledState
- a state for controlling the enabled state of the componentvalueIncludesLiteralCharacters
- only applicable if maskString
is specified
protected final JCheckBox createCheckBox(String propertyID)
propertyID
propertyID
- the ID of the property to bind
protected final JCheckBox createCheckBox(String propertyID, StateObserver enabledState)
propertyID
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the component
protected final JCheckBox createCheckBox(String propertyID, StateObserver enabledState, boolean includeCaption)
propertyID
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the componentincludeCaption
- specifies whether or not the caption should be included
protected final JCheckBox createCheckBox(Property property)
property
- the property to bind
protected final JCheckBox createCheckBox(Property property, StateObserver enabledState)
property
- the property to bindenabledState
- a state for controlling the enabled state of the component
protected final JCheckBox createCheckBox(Property property, StateObserver enabledState, boolean includeCaption)
property
- the property to bindenabledState
- a state for controlling the enabled state of the componentincludeCaption
- specifies whether or not the caption should be included
protected final TristateCheckBox createTristateCheckBox(String propertyID)
propertyID
propertyID
- the ID of the property to bind
protected final TristateCheckBox createTristateCheckBox(String propertyID, StateObserver enabledState)
propertyID
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the component
protected final TristateCheckBox createTristateCheckBox(String propertyID, StateObserver enabledState, boolean includeCaption)
propertyID
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the componentincludeCaption
- specifies whether or not the caption should be included
protected final TristateCheckBox createTristateCheckBox(Property property)
property
- the property to bind
protected final TristateCheckBox createTristateCheckBox(Property property, StateObserver enabledState)
property
- the property to bindenabledState
- a state for controlling the enabled state of the component
protected final TristateCheckBox createTristateCheckBox(Property property, StateObserver enabledState, boolean includeCaption)
property
- the property to bindenabledState
- a state for controlling the enabled state of the componentincludeCaption
- specifies whether or not the caption should be included
protected final JComboBox createBooleanComboBox(String propertyID)
propertyID
, containing
values for the boolean values: true, false, null
propertyID
- the ID of the property to bind
protected final JComboBox createBooleanComboBox(String propertyID, StateObserver enabledState)
propertyID
, containing
values for the boolean values: true, false, null
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the component
protected final JComboBox createBooleanComboBox(Property property)
property
- the property to bind
protected final JComboBox createBooleanComboBox(Property property, StateObserver enabledState)
property
- the property to bindenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createComboBox(String propertyID, ComboBoxModel comboBoxModel, boolean maximumMatch)
propertyID
propertyID
- the ID of the property to bindcomboBoxModel
- the ComboBoxModelmaximumMatch
- true if maximum match should be used
MaximumMatch
protected final SteppedComboBox createComboBox(String propertyID, ComboBoxModel comboBoxModel, boolean maximumMatch, StateObserver enabledState)
propertyID
propertyID
- the ID of the property to bindcomboBoxModel
- the ComboBoxModelmaximumMatch
- true if maximum match should be usedenabledState
- a state for controlling the enabled state of the component
MaximumMatch
protected final SteppedComboBox createComboBox(Property property, ComboBoxModel comboBoxModel, boolean maximumMatch)
property
- the property to bindcomboBoxModel
- the ComboBoxModelmaximumMatch
- true if maximum match should be used
MaximumMatch
protected final SteppedComboBox createComboBox(Property property, ComboBoxModel comboBoxModel, boolean maximumMatch, StateObserver enabledState)
property
- the property to bindcomboBoxModel
- the ComboBoxModelmaximumMatch
- true if maximum match should be usedenabledState
- a state for controlling the enabled state of the component
MaximumMatch
protected final SteppedComboBox createValueListComboBox(String propertyID)
propertyID
- the propertyID
IllegalArgumentException
- in case the property is not a value list propertyprotected final SteppedComboBox createValueListComboBox(String propertyID, StateObserver enabledState)
propertyID
- the propertyIDenabledState
- a state for controlling the enabled state of the component
IllegalArgumentException
- in case the property is not a value list propertyprotected final SteppedComboBox createValueListComboBox(Property.ValueListProperty property)
property
- the property
protected final SteppedComboBox createValueListComboBox(Property.ValueListProperty property, StateObserver enabledState)
property
- the propertyenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createEditableComboBox(String propertyID, ComboBoxModel comboBoxModel)
propertyID
propertyID
- the ID of the property to bindcomboBoxModel
- the ComboBoxModel
protected final SteppedComboBox createEditableComboBox(String propertyID, ComboBoxModel comboBoxModel, StateObserver enabledState)
propertyID
propertyID
- the ID of the property to bindcomboBoxModel
- the ComboBoxModelenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createEditableComboBox(Property property, ComboBoxModel comboBoxModel, StateObserver enabledState)
property
- the property to bindcomboBoxModel
- the ComboBoxModelenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createPropertyComboBox(String propertyID)
propertyID
, the combo box
contains the underlying values of the property
propertyID
- the ID of the property to bind
protected final SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState)
propertyID
, the combo box
contains the underlying values of the property
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState, String nullValueString)
propertyID
, the combo box
contains the underlying values of the property
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the componentnullValueString
- the value used to represent a null value, shown at the top of the combo box value list
protected final SteppedComboBox createPropertyComboBox(String propertyID, StateObserver enabledState, String nullValueString, boolean editable)
propertyID
, the combo box
contains the underlying values of the property
propertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the componentnullValueString
- the value used to represent a null value, shown at the top of the combo box value listeditable
- true if the combo box should be editable, only works with combo boxes based on String.class properties
protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property)
property
- the property to bind
protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState)
property
- the property to bindenabledState
- a state for controlling the enabled state of the component
protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState, String nullValueString)
property
- the property to bindenabledState
- a state for controlling the enabled state of the componentnullValueString
- the value used to represent a null value, shown at the top of the combo box value list
protected final SteppedComboBox createPropertyComboBox(Property.ColumnProperty property, StateObserver enabledState, String nullValueString, boolean editable)
property
- the property to bindenabledState
- a state for controlling the enabled state of the componentnullValueString
- the value used to represent a null value, shown at the top of the combo box value listeditable
- true if the combo box should be editable, only works with combo boxes based on String.class properties
protected final EntityComboBox createEntityComboBox(String foreignKeyPropertyID, StateObserver enabledState)
propertyID
foreignKeyPropertyID
- the ID of the property to bindenabledState
- a state for controlling the enabled state of the component
protected final EntityComboBox createEntityComboBox(String foreignKeyPropertyID)
propertyID
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
protected final EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty)
foreignKeyProperty
- the foreign key property to bind
protected final EntityComboBox createEntityComboBox(Property.ForeignKeyProperty foreignKeyProperty, StateObserver enabledState)
foreignKeyProperty
- the foreign key property to bind
combination used to create new instances of the entity this EntityComboBox is based on
EntityComboBox is focusableenabledState
- a state for controlling the enabled state of the component
protected final EntityLookupField createEntityLookupField(String foreignKeyPropertyID)
propertyID
, the property
must be an Property.ForeignKeyProperty
foreignKeyPropertyID
- the ID of the foreign key property to bind
protected final EntityLookupField createEntityLookupField(String foreignKeyPropertyID, String... searchPropertyIDs)
propertyID
, the property
must be an Property.ForeignKeyProperty
foreignKeyPropertyID
- the ID of the foreign key property to bindsearchPropertyIDs
- the IDs of the properties to use in the lookup
protected final EntityLookupField createEntityLookupField(Property.ForeignKeyProperty foreignKeyProperty, String... searchPropertyIDs)
foreignKeyProperty
- the foreign key property to bindsearchPropertyIDs
- the IDs of the properties to use in the lookup
protected final JTextField createEntityField(String propertyID)
propertyID
propertyID
- the ID of the property to bind
protected final JTextField createEntityField(Property.ForeignKeyProperty foreignKeyProperty)
foreignKeyProperty
- the foreign key property to bind
protected final JPanel createEntityFieldPanel(String propertyID, EntityTableModel lookupModel)
propertyID
and a button for selecting an Entity to set as the property value
propertyID
- the ID of the property to bindlookupModel
- an EntityTableModel to use when looking up entities
protected final EntityUiUtil.EntityFieldPanel createEntityFieldPanel(Property.ForeignKeyProperty foreignKeyProperty, EntityTableModel lookupModel)
foreignKeyProperty
- the foreign key property to bindlookupModel
- an EntityTableModel to use when looking up entities
protected final JLabel createLabel(String propertyID)
propertyID
propertyID
- the ID of the property from which to retrieve the caption
protected final JLabel createLabel(String propertyID, int horizontalAlignment)
propertyID
propertyID
- the ID of the property from which to retrieve the captionhorizontalAlignment
- the horizontal text alignment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |