public final class EntityUiUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static PropertyValue<java.lang.String> |
COMBO_BOX_COMPLETION_MODE
Specifies whether maximum match or autocomplete is used for comboboxes,
COMPLETION_MODE_MAXIMUM_MATCH for MaximumMatch
and COMPLETION_MODE_AUTOCOMPLETE for AutoCompletion .Value type:String Default value: COMPLETION_MODE_MAXIMUM_MATCH |
static java.lang.String |
COMPLETION_MODE_AUTOCOMPLETE
Identifies the completion mode AutoCompletion
|
static java.lang.String |
COMPLETION_MODE_MAXIMUM_MATCH
Identifies the completion mode MaximumMatch
|
static PropertyValue<java.lang.Integer> |
LABEL_TEXT_ALIGNMENT
Specifies the default horizontal alignment used in labels
Value type: Integer (JLabel.LEFT, JLabel.RIGHT, JLabel.CENTER) Default value: JLabel.LEFT |
Modifier and Type | Method and Description |
---|---|
static SteppedComboBox |
createBooleanComboBox(Property property,
EntityEditModel editModel)
Creates a combobox containing the values (null, yes, no) based on the given boolean property
|
static SteppedComboBox |
createBooleanComboBox(Property property,
EntityEditModel editModel,
StateObserver enabledState)
Creates a combobox containing the values (null, yes, no) based on the given boolean property
|
static javax.swing.JCheckBox |
createCheckBox(Property property,
EntityEditModel editModel)
Creates a JCheckBox based on the given boolean property
|
static javax.swing.JCheckBox |
createCheckBox(Property property,
EntityEditModel editModel,
StateObserver enabledState)
Creates a JCheckBox based on the given boolean property
|
static javax.swing.JCheckBox |
createCheckBox(Property property,
EntityEditModel editModel,
StateObserver enabledState,
boolean includeCaption)
Creates a JCheckBox based on the given boolean property
|
static SteppedComboBox |
createComboBox(Property property,
EntityEditModel editModel,
javax.swing.ComboBoxModel model,
StateObserver enabledState)
Creates a combo box based on the given combo box model
|
static SteppedComboBox |
createComboBox(Property property,
EntityEditModel editModel,
javax.swing.ComboBoxModel model,
StateObserver enabledState,
boolean editable)
Creates a combo box based on the given combo box model
|
static TemporalInputPanel |
createDateInputPanel(Property property,
EntityEditModel editModel,
boolean updateOnKeystroke,
boolean includeButton)
Creates a panel with a date input field and a button for opening a date input dialog
|
static TemporalInputPanel |
createDateInputPanel(Property property,
EntityEditModel editModel,
boolean updateOnKeystroke,
boolean includeCalendarButton,
StateObserver enabledState)
Creates a panel with a date input field and a button for opening a date input dialog (if applicable)
|
static javax.swing.JPanel |
createEntityComboBoxFilterPanel(EntityComboBox entityComboBox,
java.lang.String foreignKeyPropertyId,
boolean filterButtonTakesFocus)
Creates a panel containing an EntityComboBox and a button for filtering that combo box based on a foreign key
|
static EntityComboBox |
createForeignKeyComboBox(ForeignKeyProperty foreignKeyProperty,
EntityEditModel editModel)
Creates EntityComboBox based on the given foreign key property
|
static EntityComboBox |
createForeignKeyComboBox(ForeignKeyProperty foreignKeyProperty,
EntityEditModel editModel,
StateObserver enabledState)
Creates EntityComboBox based on the given foreign key property
|
static javax.swing.JTextField |
createForeignKeyField(ForeignKeyProperty foreignKeyProperty,
EntityEditModel editModel)
Creates a read-only, non-focusable JTextField displaying the value of the given property in the given edit model
|
static EntityLookupField |
createForeignKeyLookupField(ForeignKeyProperty foreignKeyProperty,
EntityEditModel editModel)
Creates a EntityLookupField based on the given foreign key property
|
static EntityLookupField |
createForeignKeyLookupField(ForeignKeyProperty foreignKeyProperty,
EntityEditModel editModel,
StateObserver enabledState)
Creates a EntityLookupField based on the given foreign key property
|
static javax.swing.JLabel |
createLabel(Property property)
Creates a JLabel with a caption from the given property, using the default label text alignment
|
static javax.swing.JLabel |
createLabel(Property property,
int horizontalAlignment)
Creates a JLabel with a caption from the given property
|
static SteppedComboBox |
createPropertyComboBox(ColumnProperty property,
EntityEditModel editModel)
Creates a combo box based on the values of the given property
|
static SteppedComboBox |
createPropertyComboBox(ColumnProperty property,
EntityEditModel editModel,
StateObserver enabledState)
Creates a combo box based on the values of the given property
|
static SteppedComboBox |
createPropertyComboBox(ColumnProperty property,
EntityEditModel editModel,
StateObserver enabledState,
boolean editable)
Creates a combo box based on the values of the given property
|
static SteppedComboBox |
createPropertyComboBox(java.lang.String propertyId,
EntityEditModel editModel)
Creates a combo box based on the values of the given property
|
static SteppedComboBox |
createPropertyComboBox(java.lang.String propertyId,
EntityEditModel editModel,
StateObserver enabledState)
Creates a combo box based on the values of the given property
|
static javax.swing.JTextArea |
createTextArea(Property property,
EntityEditModel editModel,
boolean updateOnKeystroke)
Creates a text area based on the given property
|
static javax.swing.JTextArea |
createTextArea(Property property,
EntityEditModel editModel,
int rows,
int columns,
boolean updateOnKeystroke)
Creates a text area based on the given property
|
static javax.swing.JTextArea |
createTextArea(Property property,
EntityEditModel editModel,
int rows,
int columns,
boolean updateOnKeystroke,
StateObserver enabledState)
Creates a text area based on the given property
|
static javax.swing.JTextField |
createTextField(Property property,
EntityEditModel editModel)
Creates a text field based on the given property
|
static javax.swing.JTextField |
createTextField(Property property,
EntityEditModel editModel,
java.lang.String formatMaskString,
boolean updateOnKeystroke)
Creates a text field based on the given property
|
static javax.swing.JTextField |
createTextField(Property property,
EntityEditModel editModel,
java.lang.String formatMaskString,
boolean updateOnKeystroke,
StateObserver enabledState)
Creates a text field based on the given property
|
static javax.swing.JTextField |
createTextField(Property property,
EntityEditModel editModel,
java.lang.String formatMaskString,
boolean updateOnKeystroke,
StateObserver enabledState,
boolean valueContainsLiteralCharacters)
Creates a text field based on the given property
|
static TextInputPanel |
createTextInputPanel(Property property,
EntityEditModel editModel,
boolean updateOnKeystroke,
boolean buttonFocusable)
Creates a panel with a text field and a button for opening a dialog with a text area
|
static TristateCheckBox |
createTristateCheckBox(Property property,
EntityEditModel editModel,
StateObserver enabledState,
boolean includeCaption)
Creates a TristateCheckBox based on the given boolean property
|
static SteppedComboBox |
createValueListComboBox(ValueListProperty property,
EntityEditModel editModel)
Creates a combo box based on the values in the given value list property
|
static SteppedComboBox |
createValueListComboBox(ValueListProperty property,
EntityEditModel editModel,
boolean sortItems)
Creates a combo box based on the values in the given value list property
|
static SteppedComboBox |
createValueListComboBox(ValueListProperty property,
EntityEditModel editModel,
boolean sortItems,
StateObserver enabledState)
Creates a combo box based on the values in the given value list property
|
static SteppedComboBox |
createValueListComboBox(ValueListProperty property,
EntityEditModel editModel,
StateObserver enabledState)
Creates a combo box based on the values in the given value list property
|
static java.util.Collection<Entity> |
lookupEntities(java.lang.String entityId,
EntityConnectionProvider connectionProvider,
boolean singleSelection,
javax.swing.JComponent dialogParent,
java.lang.String lookupCaption)
Performs a lookup for the given entity type, using a EntityLookupField displayed
in a dialog, using the default search properties for the given entityId.
|
static java.util.Collection<Entity> |
lookupEntities(java.lang.String entityId,
EntityConnectionProvider connectionProvider,
boolean singleSelection,
javax.swing.JComponent dialogParent,
java.lang.String lookupCaption,
java.lang.String dialogTitle)
Performs a lookup for the given entity type, using a EntityLookupField displayed
in a dialog, using the default search properties for the given entityId.
|
static void |
setLoggingLevel(javax.swing.JComponent dialogParent)
Shows a dialog for selecting the root logging level.
|
static void |
showEntityMenu(Entity entity,
javax.swing.JComponent component,
java.awt.Point location,
EntityConnectionProvider connectionProvider)
Displays a popup menu containing the values of the given entity
|
public static final java.lang.String COMPLETION_MODE_MAXIMUM_MATCH
COMBO_BOX_COMPLETION_MODE
,
Constant Field Valuespublic static final java.lang.String COMPLETION_MODE_AUTOCOMPLETE
COMBO_BOX_COMPLETION_MODE
,
Constant Field Valuespublic static final PropertyValue<java.lang.Integer> LABEL_TEXT_ALIGNMENT
public static final PropertyValue<java.lang.String> COMBO_BOX_COMPLETION_MODE
COMPLETION_MODE_MAXIMUM_MATCH
for MaximumMatch
and COMPLETION_MODE_AUTOCOMPLETE
for AutoCompletion
.COMPLETION_MODE_MAXIMUM_MATCH
public static void setLoggingLevel(javax.swing.JComponent dialogParent)
dialogParent
- the component serving as a dialog parentpublic static java.util.Collection<Entity> lookupEntities(java.lang.String entityId, EntityConnectionProvider connectionProvider, boolean singleSelection, javax.swing.JComponent dialogParent, java.lang.String lookupCaption)
entityId
- the entityId of the entity to perform a lookup forconnectionProvider
- the connection providersingleSelection
- if true only a single entity can be selecteddialogParent
- the component serving as the dialog parentlookupCaption
- the caption for the lookup field, used as a caption for the dialog as wellEntityLookupField
,
Entity.Definition#getSearchProperties()
public static java.util.Collection<Entity> lookupEntities(java.lang.String entityId, EntityConnectionProvider connectionProvider, boolean singleSelection, javax.swing.JComponent dialogParent, java.lang.String lookupCaption, java.lang.String dialogTitle)
entityId
- the entityId of the entity to perform a lookup forconnectionProvider
- the connection providersingleSelection
- if true only a single entity can be selecteddialogParent
- the component serving as the dialog parentlookupCaption
- the caption for the lookup fielddialogTitle
- the title to display on the dialogEntityLookupField
,
Entity.Definition#getSearchProperties()
public static javax.swing.JLabel createLabel(Property property)
property
- the property for which to create the labelLABEL_TEXT_ALIGNMENT
public static javax.swing.JLabel createLabel(Property property, int horizontalAlignment)
property
- the property for which to create the labelhorizontalAlignment
- the horizontal text alignmentpublic static javax.swing.JCheckBox createCheckBox(Property property, EntityEditModel editModel)
property
- the property on which value to base the checkboxeditModel
- the edit model to bind with the valuejava.lang.IllegalArgumentException
- in case the property is not a boolean propertypublic static javax.swing.JCheckBox createCheckBox(Property property, EntityEditModel editModel, StateObserver enabledState)
property
- the property on which value to base the checkboxeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the checkboxjava.lang.IllegalArgumentException
- in case the property is not a boolean propertypublic static javax.swing.JCheckBox createCheckBox(Property property, EntityEditModel editModel, StateObserver enabledState, boolean includeCaption)
property
- the property on which value to base the checkboxeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the checkboxincludeCaption
- if true then the property caption is included as the checkbox textjava.lang.IllegalArgumentException
- in case the property is not a boolean propertypublic static TristateCheckBox createTristateCheckBox(Property property, EntityEditModel editModel, StateObserver enabledState, boolean includeCaption)
property
- the property on which value to base the checkboxeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the checkboxincludeCaption
- if true then the property caption is included as the checkbox textjava.lang.IllegalArgumentException
- in case the property is not a nullable boolean propertypublic static SteppedComboBox createBooleanComboBox(Property property, EntityEditModel editModel)
property
- the property on which to base the comboboxeditModel
- the edit model to bind with the valuepublic static SteppedComboBox createBooleanComboBox(Property property, EntityEditModel editModel, StateObserver enabledState)
property
- the property on which to base the comboboxeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the comboboxpublic static EntityComboBox createForeignKeyComboBox(ForeignKeyProperty foreignKeyProperty, EntityEditModel editModel)
foreignKeyProperty
- the foreign key property on which entity to base the comboboxeditModel
- the edit model to bind with the valuepublic static EntityComboBox createForeignKeyComboBox(ForeignKeyProperty foreignKeyProperty, EntityEditModel editModel, StateObserver enabledState)
foreignKeyProperty
- the foreign key property on which entity to base the comboboxeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the comboboxpublic static javax.swing.JTextField createForeignKeyField(ForeignKeyProperty foreignKeyProperty, EntityEditModel editModel)
foreignKeyProperty
- the property which value should be displayededitModel
- the edit modelpublic static EntityLookupField createForeignKeyLookupField(ForeignKeyProperty foreignKeyProperty, EntityEditModel editModel)
foreignKeyProperty
- the foreign key property on which entity to base the lookup modeleditModel
- the edit model providing the EntityLookupModel
to use and to bind with the valuepublic static EntityLookupField createForeignKeyLookupField(ForeignKeyProperty foreignKeyProperty, EntityEditModel editModel, StateObserver enabledState)
foreignKeyProperty
- the foreign key property on which entity to base the lookup modeleditModel
- the edit model providing the EntityLookupModel
to use and to bind with the valueenabledState
- the state controlling the enabled state of the lookup fieldpublic static SteppedComboBox createValueListComboBox(ValueListProperty property, EntityEditModel editModel)
property
- the propertyeditModel
- the edit model to bind with the valuepublic static SteppedComboBox createValueListComboBox(ValueListProperty property, EntityEditModel editModel, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the combo boxpublic static SteppedComboBox createValueListComboBox(ValueListProperty property, EntityEditModel editModel, boolean sortItems)
property
- the propertyeditModel
- the edit model to bind with the valuesortItems
- if true then the items are sortedpublic static SteppedComboBox createValueListComboBox(ValueListProperty property, EntityEditModel editModel, boolean sortItems, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valuesortItems
- if true then the items are sortedenabledState
- the state controlling the enabled state of the combo boxpublic static SteppedComboBox createComboBox(Property property, EntityEditModel editModel, javax.swing.ComboBoxModel model, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valuemodel
- the combo box modelenabledState
- the state controlling the enabled state of the combo boxpublic static SteppedComboBox createComboBox(Property property, EntityEditModel editModel, javax.swing.ComboBoxModel model, StateObserver enabledState, boolean editable)
property
- the propertyeditModel
- the edit model to bind with the valuemodel
- the combo box modelenabledState
- the state controlling the enabled state of the combo boxeditable
- if true then the combo box is made editablepublic static TemporalInputPanel createDateInputPanel(Property property, EntityEditModel editModel, boolean updateOnKeystroke, boolean includeButton)
property
- the propertyeditModel
- the edit model to bind with the valueupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostincludeButton
- if true then a button for opening a date input dialog is included (only available for LocalDate)public static TemporalInputPanel createDateInputPanel(Property property, EntityEditModel editModel, boolean updateOnKeystroke, boolean includeCalendarButton, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valueupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostincludeCalendarButton
- if true then a button for opening a calendar dialog is includedenabledState
- the state controlling the enabled state of the panelpublic static TextInputPanel createTextInputPanel(Property property, EntityEditModel editModel, boolean updateOnKeystroke, boolean buttonFocusable)
property
- the propertyeditModel
- the edit model to bind with the valueupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostbuttonFocusable
- if true then the dialog button is focusablepublic static javax.swing.JTextArea createTextArea(Property property, EntityEditModel editModel, boolean updateOnKeystroke)
property
- the propertyeditModel
- the edit model to bind with the valueupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostpublic static javax.swing.JTextArea createTextArea(Property property, EntityEditModel editModel, int rows, int columns, boolean updateOnKeystroke)
property
- the propertyeditModel
- the edit model to bind with the valuerows
- the number of rowscolumns
- the number of columnsupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostpublic static javax.swing.JTextArea createTextArea(Property property, EntityEditModel editModel, int rows, int columns, boolean updateOnKeystroke, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valuerows
- the number of rowscolumns
- the number of columnsupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostenabledState
- a state indicating when the text area should be enabledpublic static javax.swing.JTextField createTextField(Property property, EntityEditModel editModel)
property
- the propertyeditModel
- the edit model to bind with the valuepublic static javax.swing.JTextField createTextField(Property property, EntityEditModel editModel, java.lang.String formatMaskString, boolean updateOnKeystroke)
property
- the propertyeditModel
- the edit model to bind with the valueformatMaskString
- if specified the resulting text field is a JFormattedField with this maskupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostpublic static javax.swing.JTextField createTextField(Property property, EntityEditModel editModel, java.lang.String formatMaskString, boolean updateOnKeystroke, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valueformatMaskString
- if specified the resulting text field is a JFormattedField with this maskupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostenabledState
- the state controlling the enabled state of the panelpublic static javax.swing.JTextField createTextField(Property property, EntityEditModel editModel, java.lang.String formatMaskString, boolean updateOnKeystroke, StateObserver enabledState, boolean valueContainsLiteralCharacters)
property
- the propertyeditModel
- the edit model to bind with the valueformatMaskString
- if specified the resulting text field is a JFormattedField with this maskupdateOnKeystroke
- if true then the value is updated on each keystroke, otherwise on focus lostenabledState
- the state controlling the enabled state of the panelvalueContainsLiteralCharacters
- whether or not the value should contain any literal characters
associated with a the format maskpublic static SteppedComboBox createPropertyComboBox(java.lang.String propertyId, EntityEditModel editModel)
propertyId
- the propertyIdeditModel
- the edit model to bind with the valuepublic static SteppedComboBox createPropertyComboBox(java.lang.String propertyId, EntityEditModel editModel, StateObserver enabledState)
propertyId
- the propertyIdeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the panelpublic static SteppedComboBox createPropertyComboBox(ColumnProperty property, EntityEditModel editModel)
property
- the propertyeditModel
- the edit model to bind with the valuepublic static SteppedComboBox createPropertyComboBox(ColumnProperty property, EntityEditModel editModel, StateObserver enabledState)
property
- the propertyeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the panelpublic static SteppedComboBox createPropertyComboBox(ColumnProperty property, EntityEditModel editModel, StateObserver enabledState, boolean editable)
property
- the propertyeditModel
- the edit model to bind with the valueenabledState
- the state controlling the enabled state of the paneleditable
- if true then the combo box will be editablepublic static javax.swing.JPanel createEntityComboBoxFilterPanel(EntityComboBox entityComboBox, java.lang.String foreignKeyPropertyId, boolean filterButtonTakesFocus)
entityComboBox
- the combo boxforeignKeyPropertyId
- the foreign key to base the filtering onfilterButtonTakesFocus
- if true then the filter button is focusablepublic static void showEntityMenu(Entity entity, javax.swing.JComponent component, java.awt.Point location, EntityConnectionProvider connectionProvider)
entity
- the entity which values to displaycomponent
- the component on which to display the popup menulocation
- the popup menu locationconnectionProvider
- the connection provider for populating the values