com.vaadin.ui.
Class OptionGroup
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField
com.vaadin.ui.AbstractSelect
com.vaadin.ui.OptionGroup
All Implemented Interfaces:
Buffered, BufferedValidatable, Container, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer, Property, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.ShortcutNotifier, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, MethodEventSource, Paintable, Sizeable, VariableOwner, Component, Component.Focusable, Field, Serializable, EventListener
- extends AbstractSelect
- implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier
public class OptionGroup
Configures select to be used as an option group.
See Also:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.data.Container |
---|
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 |
Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractSelect |
---|
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 |
Constructor Summary | |
---|---|
OptionGroup()
|
|
OptionGroup(String caption)
|
|
OptionGroup(String caption,
Collection<?> options)
|
|
OptionGroup(String caption,
Container dataSource)
|
Method Summary | |
---|---|
void |
addListener(FieldEvents.BlurListener listener)
Adds a BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
void |
addListener(FieldEvents.FocusListener listener)
Adds a FocusListener to the Component which gets fired
when a Field receives keyboard focus. |
void |
changeVariables(Object source,
Map<String,Object> variables)
Invoked when the value of a variable has changed. |
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)
|
void |
removeListener(FieldEvents.BlurListener listener)
Removes a BlurListener from the Component. |
void |
removeListener(FieldEvents.FocusListener listener)
Removes a FocusListener from the Component. |
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 visible value of the property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Field |
---|
getDescription, setCaption, setDescription |
Constructor Detail |
---|
OptionGroup
public OptionGroup()
OptionGroup
public OptionGroup(String caption,
Collection<?> options)
OptionGroup
public OptionGroup(String caption,
Container dataSource)
OptionGroup
public OptionGroup(String caption)
Method Detail |
---|
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classAbstractSelect
- Parameters:
target
- the Paint Event.- Throws:
PaintException
- if the paint operation failed.
Description copied from class: AbstractSelect
Paints the content of this component.
paintItem
protected void paintItem(PaintTarget target,
Object itemId)
throws PaintException
- Overrides:
paintItem
in classAbstractSelect
- Throws:
PaintException
changeVariables
public void changeVariables(Object source,
Map<String,Object> variables)
- Specified by:
changeVariables
in interfaceVariableOwner
- Overrides:
changeVariables
in classAbstractSelect
- Parameters:
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.- See Also:
AbstractComponent.changeVariables(java.lang.Object, java.util.Map)
Description copied from class: AbstractSelect
Invoked when the value of a variable has changed.
addListener
public void addListener(FieldEvents.BlurListener listener)
- Specified by:
addListener
in interfaceFieldEvents.BlurNotifier
- See Also:
FieldEvents.BlurListener
Description copied from interface: FieldEvents.BlurNotifier
Adds a BlurListener
to the Component which gets fired
when a Field
loses keyboard focus.
removeListener
public void removeListener(FieldEvents.BlurListener listener)
- Specified by:
removeListener
in interfaceFieldEvents.BlurNotifier
- See Also:
FieldEvents.BlurListener
Description copied from interface: FieldEvents.BlurNotifier
Removes a BlurListener
from the Component.
addListener
public void addListener(FieldEvents.FocusListener listener)
- Specified by:
addListener
in interfaceFieldEvents.FocusNotifier
- See Also:
FieldEvents.FocusListener
Description copied from interface: FieldEvents.FocusNotifier
Adds a FocusListener
to the Component which gets fired
when a Field
receives keyboard focus.
removeListener
public void removeListener(FieldEvents.FocusListener listener)
- Specified by:
removeListener
in interfaceFieldEvents.FocusNotifier
- See Also:
FieldEvents.FocusListener
Description copied from interface: FieldEvents.FocusNotifier
Removes a FocusListener
from the Component.
setValue
protected void setValue(Object newValue,
boolean repaintIsNotNeeded)
- Overrides:
setValue
in classAbstractSelect
- Parameters:
newValue
- the New selected item or collection of selected items.repaintIsNotNeeded
- True if caller is sure that repaint is not needed.- See Also:
com.vaadin.ui.AbstractField#setValue(java.lang.Object, java.lang.Boolean)
Description copied from class: AbstractSelect
Sets the visible value of the property.
The value of the select is the selected item id. If the select is in multiselect-mode, the value is a set of selected item keys. In multiselect mode all collections of id:s can be assigned.
setItemEnabled
public void setItemEnabled(Object itemId,
boolean enabled)
- Parameters:
itemId
- the id of the item to be disabled or enabledenabled
- if true the item is enabled, otherwise the item is disabled
Sets an item disabled or enabled. In the multiselect mode, a disabled item cannot be selected or deselected by the user. In the single selection mode, a disable item cannot be selected. However, programmatical selection or deselection of an disable item is possible. By default, items are enabled.
isItemEnabled
public boolean isItemEnabled(Object itemId)
- Parameters:
itemId
- the id of the item to be checked- Returns:
- true if the item is enabled, false otherwise
- See Also:
setItemEnabled(Object, boolean)
Returns true if the item is enabled.
setHtmlContentAllowed
public void setHtmlContentAllowed(boolean htmlContentAllowed)
- Parameters:
htmlContentAllowed
- true if the captions are used as html, false if used as plain text
Sets whether html is allowed in the item captions. If set to true, the captions are passed to the browser as html and the developer is responsible for ensuring no harmful html is used. If set to false, the content is passed to the browser as plain text.
isHtmlContentAllowed
public boolean isHtmlContentAllowed()
- Returns:
- true if the captions are used as html, false if used as plain text
- See Also:
setHtmlContentAllowed(boolean)
Checks whether captions are interpreted as html or plain text.