public class OptionGroup extends AbstractSelect implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier
AbstractSelect.AbstractSelectTargetDetails, AbstractSelect.AcceptItem, AbstractSelect.CaptionChangeListener, AbstractSelect.DefaultNewItemHandler, AbstractSelect.Filtering, AbstractSelect.ItemCaptionMode, AbstractSelect.ItemDescriptionGenerator, AbstractSelect.NewItemHandler, AbstractSelect.TargetItemIs, AbstractSelect.VerticalLocationIs
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
Field.ValueChangeEvent
Buffered.SourceException
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
ITEM_CAPTION_MODE_EXPLICIT, ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID, ITEM_CAPTION_MODE_ICON_ONLY, ITEM_CAPTION_MODE_ID, ITEM_CAPTION_MODE_INDEX, ITEM_CAPTION_MODE_ITEM, ITEM_CAPTION_MODE_PROPERTY, itemIdMapper, items
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
OptionGroup() |
OptionGroup(String caption) |
OptionGroup(String caption,
Collection<?> options) |
OptionGroup(String caption,
Container dataSource) |
Modifier and Type | Method and Description |
---|---|
void |
addBlurListener(FieldEvents.BlurListener listener)
Adds a
BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
void |
addFocusListener(FieldEvents.FocusListener listener)
Adds a
FocusListener to the Component which gets fired
when a Field receives keyboard focus. |
void |
addListener(FieldEvents.BlurListener listener)
Deprecated.
As of 7.0, replaced by
#addBlurListener(BlurListener) |
void |
addListener(FieldEvents.FocusListener listener)
Deprecated.
As of 7.0, replaced by
#addFocusListener(FocusListener) |
void |
changeVariables(Object source,
Map<String,Object> variables)
Invoked when the value of a variable has changed.
|
protected OptionGroupState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
boolean |
isHtmlContentAllowed()
Checks whether captions are interpreted as html or plain text.
|
boolean |
isItemEnabled(Object itemId)
Returns true if the item is enabled.
|
void |
paintContent(PaintTarget target)
Paints the content of this component.
|
protected void |
paintItem(PaintTarget target,
Object itemId) |
protected Object |
readItem(org.jsoup.nodes.Element child,
Set<String> selected,
DesignContext context)
Reads an Item from a design and inserts it into the data source.
|
void |
removeBlurListener(FieldEvents.BlurListener listener)
Removes a
BlurListener from the Component. |
void |
removeFocusListener(FieldEvents.FocusListener listener)
Removes a
FocusListener from the Component. |
void |
removeListener(FieldEvents.BlurListener listener)
Deprecated.
As of 7.0, replaced by
#removeBlurListener(BlurListener) |
void |
removeListener(FieldEvents.FocusListener listener)
Deprecated.
As of 7.0, replaced by
#removeFocusListener(FocusListener) |
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether html is allowed in the item captions.
|
void |
setItemEnabled(Object itemId,
boolean enabled)
Sets an item disabled or enabled.
|
protected void |
setValue(Object newValue,
boolean repaintIsNotNeeded)
Sets the value of the field.
|
protected org.jsoup.nodes.Element |
writeItem(org.jsoup.nodes.Element design,
Object itemId,
DesignContext context)
Writes a data source Item to a design.
|
addContainerProperty, addItem, addItem, addItems, addItems, addItemSetChangeListener, addListener, addListener, addPropertySetChangeListener, attach, containerItemSetChange, containerPropertySetChange, containsId, detach, fireItemSetChange, firePropertySetChange, getCaptionChangeListener, getContainerDataSource, getContainerProperty, getContainerPropertyIds, getItem, getItemCaption, getItemCaptionMode, getItemCaptionPropertyId, getItemIcon, getItemIconPropertyId, getItemIds, getListeners, getNewItemHandler, getNullSelectionItemId, getType, getType, getValue, getVisibleItemIds, isEmpty, isMultiSelect, isNewItemsAllowed, isNullSelectionAllowed, isSelected, readDesign, readItems, removeAllItems, removeContainerProperty, removeItem, removeItemSetChangeListener, removeListener, removeListener, removePropertySetChangeListener, sanitizeSelection, select, setContainerDataSource, setItemCaption, setItemCaptionMode, setItemCaptionPropertyId, setItemIcon, setItemIconPropertyId, setMultiSelect, setNewItemHandler, setNewItemsAllowed, setNullSelectionAllowed, setNullSelectionItemId, setValue, setValue, size, unselect, writeDesign, writeItems
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, clear, commit, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getCustomAttributes, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getTabIndex, getValidators, isBuffered, isImmediate, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setReadOnly, setRequired, setRequiredError, setTabIndex, setValidationVisible, shouldHideErrors, toString, validate, validate, valueChange
addContextClickListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
markAsDirty
isEnabled, isImmediate
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
addShortcutListener, removeShortcutListener
public OptionGroup()
public OptionGroup(String caption, Collection<?> options)
public OptionGroup(String caption)
public void paintContent(PaintTarget target) throws PaintException
AbstractSelect
paintContent
in interface LegacyComponent
paintContent
in class AbstractSelect
target
- the Paint Event.PaintException
- if the paint operation failed.protected void paintItem(PaintTarget target, Object itemId) throws PaintException
paintItem
in class AbstractSelect
PaintException
public void changeVariables(Object source, Map<String,Object> variables)
AbstractSelect
changeVariables
in interface VariableOwner
changeVariables
in class AbstractSelect
source
- the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.AbstractComponent#changeVariables(java.lang.Object, java.util.Map)
public void addBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifier
BlurListener
to the Component which gets fired
when a Field
loses keyboard focus.addBlurListener
in interface FieldEvents.BlurNotifier
FieldEvents.BlurListener
@Deprecated public void addListener(FieldEvents.BlurListener listener)
#addBlurListener(BlurListener)
addListener
in interface FieldEvents.BlurNotifier
public void removeBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifier
BlurListener
from the Component.removeBlurListener
in interface FieldEvents.BlurNotifier
FieldEvents.BlurListener
@Deprecated public void removeListener(FieldEvents.BlurListener listener)
#removeBlurListener(BlurListener)
removeListener
in interface FieldEvents.BlurNotifier
public void addFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifier
FocusListener
to the Component which gets fired
when a Field
receives keyboard focus.addFocusListener
in interface FieldEvents.FocusNotifier
FieldEvents.FocusListener
@Deprecated public void addListener(FieldEvents.FocusListener listener)
#addFocusListener(FocusListener)
addListener
in interface FieldEvents.FocusNotifier
public void removeFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifier
FocusListener
from the Component.removeFocusListener
in interface FieldEvents.FocusNotifier
FieldEvents.FocusListener
@Deprecated public void removeListener(FieldEvents.FocusListener listener)
#removeFocusListener(FocusListener)
removeListener
in interface FieldEvents.FocusNotifier
protected void setValue(Object newValue, boolean repaintIsNotNeeded)
AbstractField
setValue
in class AbstractField<Object>
newValue
- the New value of the field.repaintIsNotNeeded
- True iff caller is sure that repaint is not needed.public void setItemEnabled(Object itemId, boolean enabled)
itemId
- the id of the item to be disabled or enabledenabled
- if true the item is enabled, otherwise the item is disabledpublic boolean isItemEnabled(Object itemId)
itemId
- the id of the item to be checkedsetItemEnabled(Object, boolean)
public void setHtmlContentAllowed(boolean htmlContentAllowed)
htmlContentAllowed
- true if the captions are used as html, false if used as plain
textpublic boolean isHtmlContentAllowed()
setHtmlContentAllowed(boolean)
protected Object readItem(org.jsoup.nodes.Element child, Set<String> selected, DesignContext context)
AbstractSelect
readItem
in class AbstractSelect
child
- a child element representing the itemselected
- A set accumulating selected items. If the item that is read is
marked as selected, its item id should be added to this set.context
- the DesignContext instance used in parsingprotected org.jsoup.nodes.Element writeItem(org.jsoup.nodes.Element design, Object itemId, DesignContext context)
AbstractSelect
writeItem
in class AbstractSelect
design
- the element into which to insert the itemitemId
- the id of the item to writecontext
- the DesignContext instance used in writingprotected OptionGroupState getState()
AbstractComponent
getState
in class AbstractSelect
Copyright © 2019 Vaadin Ltd. All rights reserved.