public class DesktopLookupField extends DesktopAbstractOptionsField<javax.swing.JComponent> implements LookupField, com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler
DesktopAbstractOptionsField.CaptionFormatter<T>, DesktopAbstractOptionsField.EntityWrapper, DesktopAbstractOptionsField.MapKeyWrapper, DesktopAbstractOptionsField.ObjectWrapper, DesktopAbstractOptionsField.ValueWrapper<T>
LookupField.FilterMode, LookupField.NewOptionHandler, LookupField.OptionIconProvider<T>
Field.Validator
Component.ActionOwner, Component.ActionsHolder, Component.Alignment, Component.BelongToFrame, Component.Buffered, Component.ChildEditableController, Component.Collapsable, Component.Container, Component.Disposable, Component.Editable, Component.EditableChangeEvent, Component.EditableChangeListener, Component.EditableChangeNotifier, Component.ExpandedStateChangeEvent, Component.ExpandedStateChangeListener, Component.Focusable, Component.HasBorder, Component.HasButtonsPanel, Component.HasCaption, Component.HasFormatter, Component.HasIcon, Component.HasInputPrompt, Component.HasNamedComponents, Component.HasPresentations, Component.HasRowsCount, Component.HasSettings, Component.HasValue, Component.HasXmlDescriptor, Component.LayoutClickEvent, Component.LayoutClickListener, Component.LayoutClickNotifier, Component.Margin, Component.MouseEventDetails, Component.OrderedContainer, Component.OuterMargin, Component.SecuredActionsHolder, Component.ShortcutAction, Component.ShortcutNotifier, Component.ShortcutTriggeredEvent, Component.Spacing, Component.UiPermissionAware, Component.Validatable, Component.ValueChangeEvent, Component.ValueChangeListener, Component.Wrapper
LookupComponent.LookupSelectionChangeEvent, LookupComponent.LookupSelectionChangeListener, LookupComponent.LookupSelectionChangeNotifier
SWING_PROPERTY_CLASS, SWING_PROPERTY_ID
NAME
AUTO_SIZE, AUTO_SIZE_PX, UNITS_PERCENTAGE, UNITS_PIXELS
Constructor and Description |
---|
DesktopLookupField() |
Modifier and Type | Method and Description |
---|---|
void |
addUserSelectionListener(com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler.UserSelectionListener listener) |
void |
commit()
Updates all changes since the previous commit to the data source.
|
void |
discard()
Discards all changes since last commit.
|
javax.swing.JComponent |
getComposition() |
java.lang.String |
getDescription() |
LookupField.FilterMode |
getFilterMode() |
java.lang.String |
getInputPrompt() |
java.util.Collection |
getLookupSelectedItems() |
LookupField.NewOptionHandler |
getNewOptionHandler() |
java.lang.Object |
getNullOption() |
LookupField.OptionIconProvider<?> |
getOptionIconProvider() |
int |
getPageLength() |
<T> T |
getValue() |
boolean |
isBuffered() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
boolean |
isMultiSelect() |
boolean |
isNewOptionAllowed() |
boolean |
isNullOptionVisible() |
boolean |
isTextInputAllowed() |
void |
removeUserSelectionListener(com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler.UserSelectionListener listener) |
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setCaptionProperty(java.lang.String captionProperty) |
void |
setDescription(java.lang.String description) |
void |
setFilterMode(LookupField.FilterMode mode) |
void |
setInputPrompt(java.lang.String inputPrompt)
Sets the input prompt - a textual prompt that is displayed when the field
would otherwise be empty, to prompt the user for input.
|
void |
setLookupSelectHandler(java.lang.Runnable selectHandler) |
void |
setMultiSelect(boolean multiselect) |
void |
setNewOptionAllowed(boolean newOptionAllowed)
Makes the component handle new options entered by user.
|
void |
setNewOptionHandler(LookupField.NewOptionHandler newOptionHandler)
Set handler.
|
void |
setNullOption(java.lang.Object nullOption) |
void |
setNullOptionVisible(boolean nullOptionVisible)
Sets visibility for first null element in suggestion popup.
|
<T> void |
setOptionIconProvider(java.lang.Class<T> optionClass,
LookupField.OptionIconProvider<T> optionIconProvider)
Set the icon provider for LookupField.
|
void |
setOptionIconProvider(LookupField.OptionIconProvider<?> optionIconProvider)
Set the icon provider for the LookupField.
|
void |
setOptionsEnum(java.lang.Class<? extends EnumClass> optionsEnum) |
void |
setOptionsList(java.util.List optionsList) |
void |
setOptionsMap(java.util.Map<java.lang.String,?> map) |
void |
setPageLength(int pageLength)
Sets the page length for the suggestion popup.
|
void |
setTextInputAllowed(boolean textInputAllowed)
Sets whether it is possible to input text into the field or whether the field area of the component is just used
to show what is selected.
|
void |
setValue(java.lang.Object value) |
void |
updateEnabled() |
void |
updateMissingValueState() |
getCaptionMode, getCaptionProperty, getDatasource, getDescriptionProperty, getMetaProperty, getMetaPropertyPath, getOptionsDatasource, getOptionsEnum, getOptionsList, getOptionsMap, setCaptionFormatter, setCaptionMode, setDatasource, setDescriptionProperty, setOptionsDatasource
addListener, addValidator, addValueChangeListener, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeListener, removeValidator, removeValueChangeListener, setEditable, setParent, setRequired, setRequiredMessage, validate
addStyleName, assignAutoDebugId, getAlignment, getCaption, getComponent, getDebugId, getFrame, getHeight, getHeightUnits, getIcon, getId, getParent, getStyleName, getTabIndex, getWidth, getWidthUnits, getXmlDescriptor, isComponentVisible, isEnabled, isEnabledItself, isParentEnabled, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setCaption, setContainer, setDebugId, setEnabled, setExpanded, setFrame, setHeight, setIcon, setId, setParentEnabled, setResponsive, setStyleName, setTabIndex, setVisible, setWidth, setXmlDescriptor, unwrap, unwrapComposition
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCaptionMode, getCaptionProperty, getDescriptionProperty, getOptionsDatasource, getOptionsEnum, getOptionsList, getOptionsMap, setCaptionMode, setDescriptionProperty, setOptionsDatasource
addValidator, getRequiredMessage, getValidators, isRequired, removeValidator, setRequired, setRequiredMessage
getDatasource, getMetaProperty, getMetaPropertyPath, setDatasource
addListener, addValueChangeListener, removeListener, removeValueChangeListener
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getDebugId, getHeight, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthUnits, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setDebugId, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getCaption, setCaption
isValid, isValidateOnCommit, validate
getIcon, setIcon
getTabIndex, isFocusable, setFocusable, setTabIndex
public javax.swing.JComponent getComposition()
getComposition
in interface Component.Wrapper
getComposition
in class DesktopAbstractComponent<javax.swing.JComponent>
public java.lang.Object getNullOption()
getNullOption
in interface LookupField
public void setNullOption(java.lang.Object nullOption)
setNullOption
in interface LookupField
public LookupField.FilterMode getFilterMode()
getFilterMode
in interface LookupField
public void setFilterMode(LookupField.FilterMode mode)
setFilterMode
in interface LookupField
public boolean isNewOptionAllowed()
isNewOptionAllowed
in interface LookupField
LookupField.NewOptionHandler
public void setNewOptionAllowed(boolean newOptionAllowed)
LookupField
setNewOptionAllowed
in interface LookupField
LookupField.NewOptionHandler
public boolean isTextInputAllowed()
isTextInputAllowed
in interface LookupField
public void setTextInputAllowed(boolean textInputAllowed)
LookupField
setTextInputAllowed
in interface LookupField
public LookupField.NewOptionHandler getNewOptionHandler()
getNewOptionHandler
in interface LookupField
public void setNewOptionHandler(LookupField.NewOptionHandler newOptionHandler)
LookupField
setNewOptionHandler
in interface LookupField
newOptionHandler
- handler instancepublic int getPageLength()
getPageLength
in interface LookupField
public void setPageLength(int pageLength)
LookupField
setPageLength
in interface LookupField
pageLength
- the pageLength to setpublic void setNullOptionVisible(boolean nullOptionVisible)
LookupField
setNullOptionVisible
in interface LookupField
public boolean isNullOptionVisible()
isNullOptionVisible
in interface LookupField
public void setOptionIconProvider(LookupField.OptionIconProvider<?> optionIconProvider)
LookupField
setOptionIconProvider
in interface LookupField
optionIconProvider
- provider which provides icons for optionspublic <T> void setOptionIconProvider(java.lang.Class<T> optionClass, LookupField.OptionIconProvider<T> optionIconProvider)
LookupField
setOptionIconProvider
in interface LookupField
optionClass
- class of the optionoptionIconProvider
- provider which provides icons for optionspublic LookupField.OptionIconProvider<?> getOptionIconProvider()
getOptionIconProvider
in interface LookupField
public java.lang.String getInputPrompt()
getInputPrompt
in interface Component.HasInputPrompt
public void setInputPrompt(java.lang.String inputPrompt)
Component.HasInputPrompt
setInputPrompt
in interface Component.HasInputPrompt
inputPrompt
- input promptpublic boolean isMultiSelect()
isMultiSelect
in interface OptionsField
public void setMultiSelect(boolean multiselect)
setMultiSelect
in interface OptionsField
public void setOptionsList(java.util.List optionsList)
setOptionsList
in interface OptionsField
setOptionsList
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public void setOptionsMap(java.util.Map<java.lang.String,?> map)
setOptionsMap
in interface OptionsField
setOptionsMap
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public void setOptionsEnum(java.lang.Class<? extends EnumClass> optionsEnum)
setOptionsEnum
in interface OptionsField
setOptionsEnum
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public java.lang.String getDescription()
getDescription
in interface Component.HasCaption
public void setDescription(java.lang.String description)
setDescription
in interface Component.HasCaption
public void updateMissingValueState()
updateMissingValueState
in class DesktopAbstractField<javax.swing.JComponent>
public void setValue(java.lang.Object value)
setValue
in interface Component.HasValue
setValue
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public <T> T getValue()
getValue
in interface Component.HasValue
getValue
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public void updateEnabled()
public void setCaptionProperty(java.lang.String captionProperty)
setCaptionProperty
in interface OptionsField
setCaptionProperty
in class DesktopAbstractOptionsField<javax.swing.JComponent>
public void addUserSelectionListener(com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler.UserSelectionListener listener)
addUserSelectionListener
in interface com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler
public void removeUserSelectionListener(com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler.UserSelectionListener listener)
removeUserSelectionListener
in interface com.haulmont.cuba.desktop.sys.vcl.UserSelectionHandler
public void setLookupSelectHandler(java.lang.Runnable selectHandler)
setLookupSelectHandler
in interface LookupComponent
selectHandler
- handler that should be executed when a user select an item in the lookup screenpublic java.util.Collection getLookupSelectedItems()
getLookupSelectedItems
in interface LookupComponent
public void commit()
Component.Buffered
commit
in interface Component.Buffered
public void discard()
Component.Buffered
discard
in interface Component.Buffered
public boolean isBuffered()
isBuffered
in interface Component.Buffered
true
if buffered mode is on, false
otherwisepublic void setBuffered(boolean buffered)
Component.Buffered
When in buffered mode, an internal buffer will be used to store changes
until Component.Buffered.commit()
is called. Calling Component.Buffered.discard()
will revert
the internal buffer to the value of the data source.
When in non-buffered mode both read and write operations will be done
directly on the data source. In this mode the Component.Buffered.commit()
and
Component.Buffered.discard()
methods serve no purpose.
setBuffered
in interface Component.Buffered
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isModified()
Component.Buffered
isModified
in interface Component.Buffered
true
if the value in the object has been modified
since the last data source update, false
if not.