com.vaadin.ui
Class OptionGroup

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractField<java.lang.Object>
              extended by com.vaadin.ui.AbstractSelect
                  extended by com.vaadin.ui.OptionGroup
All Implemented Interfaces:
Buffered, BufferedValidatable, Container, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer, Property<java.lang.Object>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, Action.ShortcutNotifier, ConnectorEventListener, FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, MethodEventSource, ClientConnector, Sizeable, VariableOwner, com.vaadin.shared.Connector, Component, Component.Focusable, Field<java.lang.Object>, LegacyComponent, java.io.Serializable, java.util.EventListener

public class OptionGroup
extends AbstractSelect
implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier

Configures select to be used as an option group.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractSelect
AbstractSelect.AbstractSelectTargetDetails, AbstractSelect.AcceptItem, AbstractSelect.CaptionChangeListener, AbstractSelect.DefaultNewItemHandler, AbstractSelect.Filtering, AbstractSelect.ItemCaptionMode, AbstractSelect.ItemDescriptionGenerator, AbstractSelect.NewItemHandler, AbstractSelect.TargetItemIs, AbstractSelect.VerticalLocationIs
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent
 
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.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
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.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, 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
 
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
OptionGroup()
           
OptionGroup(java.lang.String caption)
           
OptionGroup(java.lang.String caption, java.util.Collection<?> options)
           
OptionGroup(java.lang.String caption, Container dataSource)
           
 
Method Summary
 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(java.lang.Object source, java.util.Map<java.lang.String,java.lang.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(java.lang.Object itemId)
          Returns true if the item is enabled.
 void paintContent(PaintTarget target)
          Paints the content of this component.
protected  void paintItem(PaintTarget target, java.lang.Object itemId)
           
protected  java.lang.Object readItem(org.jsoup.nodes.Element child, java.util.Set<java.lang.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(java.lang.Object itemId, boolean enabled)
          Sets an item disabled or enabled.
protected  void setValue(java.lang.Object newValue, boolean repaintIsNotNeeded)
          Sets the visible value of the property.
protected  org.jsoup.nodes.Element writeItem(org.jsoup.nodes.Element design, java.lang.Object itemId, DesignContext context)
          Writes a data source Item to a design.
 
Methods inherited from class com.vaadin.ui.AbstractSelect
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, size, unselect, writeDesign, writeItems
 
Methods inherited from class com.vaadin.ui.AbstractField
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, clear, commit, discard, fireReadOnlyStatusChange, fireValueChange, focus, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getCustomAttributes, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, 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
 
Methods inherited from class com.vaadin.ui.AbstractComponent
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, 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
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.LegacyComponent
markAsDirty
 
Methods inherited from interface com.vaadin.server.VariableOwner
isEnabled, isImmediate
 
Methods inherited from interface com.vaadin.ui.Component
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
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
 
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListener
 

Constructor Detail

OptionGroup

public OptionGroup()

OptionGroup

public OptionGroup(java.lang.String caption,
                   java.util.Collection<?> options)

OptionGroup

public OptionGroup(java.lang.String caption,
                   Container dataSource)

OptionGroup

public OptionGroup(java.lang.String caption)
Method Detail

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Description copied from class: AbstractSelect
Paints the content of this component.

Specified by:
paintContent in interface LegacyComponent
Overrides:
paintContent in class AbstractSelect
Parameters:
target - the Paint Event.
Throws:
PaintException - if the paint operation failed.

paintItem

protected void paintItem(PaintTarget target,
                         java.lang.Object itemId)
                  throws PaintException
Overrides:
paintItem in class AbstractSelect
Throws:
PaintException

changeVariables

public void changeVariables(java.lang.Object source,
                            java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from class: AbstractSelect
Invoked when the value of a variable has changed.

Specified by:
changeVariables in interface VariableOwner
Overrides:
changeVariables in class AbstractSelect
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:
com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, java.util.Map)

addBlurListener

public void addBlurListener(FieldEvents.BlurListener listener)
Description copied from interface: FieldEvents.BlurNotifier
Adds a BlurListener to the Component which gets fired when a Field loses keyboard focus.

Specified by:
addBlurListener in interface FieldEvents.BlurNotifier
See Also:
FieldEvents.BlurListener

addListener

@Deprecated
public void addListener(FieldEvents.BlurListener listener)
Deprecated. As of 7.0, replaced by #addBlurListener(BlurListener)

Specified by:
addListener in interface FieldEvents.BlurNotifier

removeBlurListener

public void removeBlurListener(FieldEvents.BlurListener listener)
Description copied from interface: FieldEvents.BlurNotifier
Removes a BlurListener from the Component.

Specified by:
removeBlurListener in interface FieldEvents.BlurNotifier
See Also:
FieldEvents.BlurListener

removeListener

@Deprecated
public void removeListener(FieldEvents.BlurListener listener)
Deprecated. As of 7.0, replaced by #removeBlurListener(BlurListener)

Specified by:
removeListener in interface FieldEvents.BlurNotifier

addFocusListener

public void addFocusListener(FieldEvents.FocusListener listener)
Description copied from interface: FieldEvents.FocusNotifier
Adds a FocusListener to the Component which gets fired when a Field receives keyboard focus.

Specified by:
addFocusListener in interface FieldEvents.FocusNotifier
See Also:
FieldEvents.FocusListener

addListener

@Deprecated
public void addListener(FieldEvents.FocusListener listener)
Deprecated. As of 7.0, replaced by #addFocusListener(FocusListener)

Specified by:
addListener in interface FieldEvents.FocusNotifier

removeFocusListener

public void removeFocusListener(FieldEvents.FocusListener listener)
Description copied from interface: FieldEvents.FocusNotifier
Removes a FocusListener from the Component.

Specified by:
removeFocusListener in interface FieldEvents.FocusNotifier
See Also:
FieldEvents.FocusListener

removeListener

@Deprecated
public void removeListener(FieldEvents.FocusListener listener)
Deprecated. As of 7.0, replaced by #removeFocusListener(FocusListener)

Specified by:
removeListener in interface FieldEvents.FocusNotifier

setValue

protected void setValue(java.lang.Object newValue,
                        boolean repaintIsNotNeeded)
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.

Overrides:
setValue in class AbstractSelect
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)

setItemEnabled

public void setItemEnabled(java.lang.Object itemId,
                           boolean enabled)
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.

Parameters:
itemId - the id of the item to be disabled or enabled
enabled - if true the item is enabled, otherwise the item is disabled

isItemEnabled

public boolean isItemEnabled(java.lang.Object itemId)
Returns true if the item is enabled.

Parameters:
itemId - the id of the item to be checked
Returns:
true if the item is enabled, false otherwise
See Also:
setItemEnabled(Object, boolean)

setHtmlContentAllowed

public void setHtmlContentAllowed(boolean htmlContentAllowed)
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.

Parameters:
htmlContentAllowed - true if the captions are used as html, false if used as plain text

isHtmlContentAllowed

public boolean isHtmlContentAllowed()
Checks whether captions are interpreted as html or plain text.

Returns:
true if the captions are used as html, false if used as plain text
See Also:
setHtmlContentAllowed(boolean)

readItem

protected java.lang.Object readItem(org.jsoup.nodes.Element child,
                                    java.util.Set<java.lang.String> selected,
                                    DesignContext context)
Description copied from class: AbstractSelect
Reads an Item from a design and inserts it into the data source. Hierarchical select components should override this method to recursively recursively read any child items as well.

Overrides:
readItem in class AbstractSelect
Parameters:
child - a child element representing the item
selected - 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 parsing
Returns:
the item id of the new item

writeItem

protected org.jsoup.nodes.Element writeItem(org.jsoup.nodes.Element design,
                                            java.lang.Object itemId,
                                            DesignContext context)
Description copied from class: AbstractSelect
Writes a data source Item to a design. Hierarchical select components should override this method to recursively write any child items as well.

Overrides:
writeItem in class AbstractSelect
Parameters:
design - the element into which to insert the item
itemId - the id of the item to write
context - the DesignContext instance used in writing
Returns:


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.