com.itmill.toolkit.ui
Class Select

java.lang.Object
  extended by com.itmill.toolkit.terminal.Identifiable
      extended by com.itmill.toolkit.ui.AbstractComponent
          extended by com.itmill.toolkit.ui.AbstractField
              extended by com.itmill.toolkit.ui.Select
All Implemented Interfaces:
Buffered, BufferedValidatable, Container, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer, Property, Property.Editor, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Validatable, MethodEventSource, Paintable, VariableOwner, Component, Component.Focusable, Field, EventListener
Direct Known Subclasses:
Table, Tree

public class Select
extends AbstractField
implements Container, Container.Viewer, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.ItemSetChangeNotifier, Container.ItemSetChangeListener

A class representing a selection of items the user has selected in a UI. The set of choices is presented as a set of Items in a Container.

A Select component may be in single- or multiselect mode. Multiselect mode means that more than one item can be selected simultaneously.

Since:
3.0
Version:
4.1.4
Author:
IT Mill Ltd.

Nested Class Summary
protected  class Select.OptionsStream
           
 
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractField
AbstractField.ReadOnlyStatusChangeEvent
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Container
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Sortable, Container.Viewer
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field
Field.ValueChangeEvent
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered
Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Property
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
 
Field Summary
static int ITEM_CAPTION_MODE_EXPLICIT
          Item caption mode: Captions must be explicitly specified.
static int ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
          Item caption mode: If an Item has a caption it's used, if not, Item's ID's String representation is used as caption.
static int ITEM_CAPTION_MODE_ICON_ONLY
          Item caption mode: Only icons are shown, captions are hidden.
static int ITEM_CAPTION_MODE_ID
          Item caption mode: Item's ID's String representation is used as caption.
static int ITEM_CAPTION_MODE_INDEX
          Item caption mode: Index of the item is used as caption.
static int ITEM_CAPTION_MODE_ITEM
          Item caption mode: Item's String representation is used as caption.
static int ITEM_CAPTION_MODE_PROPERTY
          Item caption mode: Item captions are read from property specified with setItemCaptionPropertyId.
protected  KeyMapper itemIdMapper
          Keymapper used to map key values.
protected  Container items
          Select options.
 
Fields inherited from interface com.itmill.toolkit.data.Container
NULL_ITEM_ID
 
Constructor Summary
Select()
          Creates an empty Select.
Select(String caption)
          Creates an empty Select with caption.
Select(String caption, Collection options)
          Creates a new select that is filled from a collection of option values.
Select(String caption, Container dataSource)
          Creates a new select wthat is connected to a data-source.
 
Method Summary
 boolean addContainerProperty(Object propertyId, Class type, Object defaultValue)
          Adds the new property to all items.
 Object addItem()
          Creates a new item into container with container managed id.
 Item addItem(Object itemId)
          Create a new item into container.
 void addListener(Container.ItemSetChangeListener listener)
          Adds an Item set change listener for the object.
 void addListener(Container.PropertySetChangeListener listener)
          Adds a new Property set change listener for this Container.
 void attach()
          Notifies the component that it is connected to an application.
 void changeVariables(Object source, Map variables)
          Invoked when the value of a variable has changed.
 void containerItemSetChange(Container.ItemSetChangeEvent event)
          Lets the listener know a Containers Item set has changed.
 void containerPropertySetChange(Container.PropertySetChangeEvent event)
          Notifies this listener that the Containers contents has changed.
 boolean containsId(Object itemId)
          Tests, if the collection contains an item with given id.
 void detach()
          Detaches the component from application.
static String escapeJSON(String s)
           
protected  void fireItemSetChange()
          Fires the item set change event.
protected  void firePropertySetChange()
          Fires the property set change event.
 Container getContainerDataSource()
          Gets the viewing data-source container.
 Property getContainerProperty(Object itemId, Object propertyId)
          Gets the Property identified by the given itemId and propertyId from the Container
 Collection getContainerPropertyIds()
          Gets the property Id collection from the container.
 Item getItem(Object itemId)
          Gets the item from the container with given id.
 String getItemCaption(Object itemId)
          Gets the caption of an item.
 int getItemCaptionMode()
          Gets the item caption mode.
 Object getItemCaptionPropertyId()
          Gets the item caption property.
 Resource getItemIcon(Object itemId)
          Gets the item icon.
 Object getItemIconPropertyId()
          Gets the item icon property.
 Collection getItemIds()
          Gets the item Id collection from the container.
 Object getNullSelectionItemId()
          Returns the item id that represents null value of this select in single select mode.
 OptionFilter getOptionFilter()
           
 String getTag()
          Gets the component UIDL tag.
 Class getType()
          Returns the type of the property.
 Class getType(Object propertyId)
          Gets the property type.
 Object getValue()
          Gets the selected item id or in multiselect mode a set of selected ids.
 Collection getVisibleItemIds()
          Gets the visible item ids.
 boolean isLazyLoading()
           
 boolean isMultiSelect()
          Is the select in multiselect mode?
 boolean isNewItemsAllowed()
          Does the select allow adding new options by the user.
 boolean isSelected(Object itemId)
          Tests if an item is selected.
 void paintContent(PaintTarget target)
          Paints the content of this component.
 boolean removeAllItems()
          Removes all items from the container.
 boolean removeContainerProperty(Object propertyId)
          Removes the property from all items.
 boolean removeItem(Object itemId)
          Removes the item identified by Id from the container.
 void removeListener(Container.ItemSetChangeListener listener)
          Removes the Item set change listener from the object.
 void removeListener(Container.PropertySetChangeListener listener)
          Removes a previously registered Property set change listener.
 void select(Object itemId)
          Selects an item.
 void setContainerDataSource(Container newDataSource)
          Sets the container as data-source for viewing.
 void setItemCaption(Object itemId, String caption)
          Override the caption of an item.
 void setItemCaptionMode(int mode)
          Sets the item caption mode.
 void setItemCaptionPropertyId(Object propertyId)
          Sets the item caption property.
 void setItemIcon(Object itemId, Resource icon)
          Sets the icon for an item.
 void setItemIconPropertyId(Object propertyId)
          Sets the item icon property.
 void setLazyLoading(boolean useLazyLoading)
           
 void setLazyLoading(boolean useLazyLoading, Application app, Select.OptionsStream optionsStream)
           
 void setMultiSelect(boolean multiSelect)
          Sets the multiselect mode.
 void setNewItemsAllowed(boolean allowNewOptions)
          Enables or disables possibility to add new options by the user.
 void setNullSelectionItemId(Object nullSelectionItemId)
          Sets the item id that represents null value of this select.
 void setOptionFilter(OptionFilter of)
           
 void setValue(Object newValue)
          Sets the visible value of the property.
 int size()
          Gets the number of Items in the Container.
 void unselect(Object itemId)
          Unselects an item.
 
Methods inherited from class com.itmill.toolkit.ui.AbstractField
addListener, addListener, addValidator, commit, constructField, discard, finalize, fireReadOnlyStatusChange, fireValueChange, focus, getErrorMessage, getFocusableId, getPropertyDataSource, getTabIndex, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInternalValue, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setTabIndex, setWriteThrough, toString, validate, valueChange
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponent
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible
 
Methods inherited from class com.itmill.toolkit.terminal.Identifiable
getDebugId, getUIID, setDebugId, setUIID
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.itmill.toolkit.ui.Field
getDescription, setCaption, setDescription
 
Methods inherited from interface com.itmill.toolkit.ui.Component
addListener, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isVisible, removeListener, setEnabled, setParent, setStyle, setVisible
 
Methods inherited from interface com.itmill.toolkit.terminal.Paintable
addListener, paint, removeListener, requestRepaint, requestRepaintRequests
 
Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner
dependsOn, getDirectDependencies, isImmediate, removeDirectDependency
 

Field Detail

ITEM_CAPTION_MODE_ID

public static final int ITEM_CAPTION_MODE_ID
Item caption mode: Item's ID's String representation is used as caption.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_ITEM

public static final int ITEM_CAPTION_MODE_ITEM
Item caption mode: Item's String representation is used as caption.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_INDEX

public static final int ITEM_CAPTION_MODE_INDEX
Item caption mode: Index of the item is used as caption. The index mode can only be used with the containers implementing the Container.Indexed interface.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID

public static final int ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
Item caption mode: If an Item has a caption it's used, if not, Item's ID's String representation is used as caption. This is the default.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_EXPLICIT

public static final int ITEM_CAPTION_MODE_EXPLICIT
Item caption mode: Captions must be explicitly specified.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_ICON_ONLY

public static final int ITEM_CAPTION_MODE_ICON_ONLY
Item caption mode: Only icons are shown, captions are hidden.

See Also:
Constant Field Values

ITEM_CAPTION_MODE_PROPERTY

public static final int ITEM_CAPTION_MODE_PROPERTY
Item caption mode: Item captions are read from property specified with setItemCaptionPropertyId.

See Also:
Constant Field Values

items

protected Container items
Select options.


itemIdMapper

protected KeyMapper itemIdMapper
Keymapper used to map key values.

Constructor Detail

Select

public Select()
Creates an empty Select. The caption is not used.


Select

public Select(String caption)
Creates an empty Select with caption.


Select

public Select(String caption,
              Container dataSource)
Creates a new select wthat is connected to a data-source.

Parameters:
caption - the Caption of the component.
dataSource - the Container datasource to be selected from by this select.

Select

public Select(String caption,
              Collection options)
Creates a new select that is filled from a collection of option values.

Parameters:
caption - the Caption of this field.
options - the Collection containing the options.
Method Detail

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Paints the content of this component.

Overrides:
paintContent in class AbstractField
Parameters:
target - the Paint Event.
Throws:
PaintException - if the paint operation failed.

changeVariables

public void changeVariables(Object source,
                            Map variables)
Invoked when the value of a variable has changed.

Specified by:
changeVariables in interface VariableOwner
Overrides:
changeVariables in class AbstractComponent
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)

getTag

public String getTag()
Gets the component UIDL tag.

Specified by:
getTag in class AbstractComponent
Returns:
the Component UIDL tag as string.

getVisibleItemIds

public Collection getVisibleItemIds()
Gets the visible item ids. In Select, this returns list of all item ids, but can be overriden in subclasses if they paint only part of the items to the terminal or null if no items is visible.


getType

public Class getType()
Returns the type of the property. getValue and setValue methods must be compatible with this type: one can safely cast getValue to given type and pass any variable assignable to this type as a parameter to setValue.

Specified by:
getType in interface Property
Specified by:
getType in class AbstractField
Returns:
the Type of the property.

getValue

public Object getValue()
Gets the selected item id or in multiselect mode a set of selected ids.

Specified by:
getValue in interface Property
Overrides:
getValue in class AbstractField
Returns:
the current value of the field.
See Also:
AbstractField.getValue()

setValue

public void setValue(Object newValue)
              throws Property.ReadOnlyException,
                     Property.ConversionException
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.

Specified by:
setValue in interface Property
Overrides:
setValue in class AbstractField
Parameters:
newValue - the New selected item or collection of selected items.
Throws:
Property.ReadOnlyException - if the object is in read-only mode
Property.ConversionException - if newValue can't be converted into the Property's native type directly or through String
See Also:
AbstractField.setValue(java.lang.Object)

getItem

public Item getItem(Object itemId)
Gets the item from the container with given id. If the container does not contain the requested item, null is returned.

Specified by:
getItem in interface Container
Parameters:
itemId - the item id.
Returns:
the item from the container.

getItemIds

public Collection getItemIds()
Gets the item Id collection from the container.

Specified by:
getItemIds in interface Container
Returns:
the Collection of item ids.

getContainerPropertyIds

public Collection getContainerPropertyIds()
Gets the property Id collection from the container.

Specified by:
getContainerPropertyIds in interface Container
Returns:
the Collection of property ids.

getType

public Class getType(Object propertyId)
Gets the property type.

Specified by:
getType in interface Container
Parameters:
propertyId - the Id identifying the property.
Returns:
data type of the Properties
See Also:
Container.getType(java.lang.Object)

size

public int size()
Description copied from interface: Container
Gets the number of Items in the Container.

Specified by:
size in interface Container
Returns:
number of Items in the Container

containsId

public boolean containsId(Object itemId)
Tests, if the collection contains an item with given id.

Specified by:
containsId in interface Container
Parameters:
itemId - the Id the of item to be tested.
Returns:
boolean indicating if the Container holds the specified Item

getContainerProperty

public Property getContainerProperty(Object itemId,
                                     Object propertyId)
Gets the Property identified by the given itemId and propertyId from the Container

Specified by:
getContainerProperty in interface Container
Parameters:
itemId - ID of the Item which contains the Property
propertyId - ID of the Property to retrieve
Returns:
Property with the given ID or null
See Also:
Container.getContainerProperty(Object, Object)

addContainerProperty

public boolean addContainerProperty(Object propertyId,
                                    Class type,
                                    Object defaultValue)
                             throws UnsupportedOperationException
Adds the new property to all items. Adds a property with given id, type and default value to all items in the container. This functionality is optional. If the function is unsupported, it always returns false.

Specified by:
addContainerProperty in interface Container
Parameters:
propertyId - ID of the Property
type - Data type of the new Property
defaultValue - The value all created Properties are initialized to
Returns:
True if the operation succeeded.
Throws:
UnsupportedOperationException
See Also:
Container.addContainerProperty(java.lang.Object, java.lang.Class, java.lang.Object)

removeAllItems

public boolean removeAllItems()
                       throws UnsupportedOperationException
Removes all items from the container. This functionality is optional. If the function is unsupported, it always returns false.

Specified by:
removeAllItems in interface Container
Returns:
True if the operation succeeded.
Throws:
UnsupportedOperationException
See Also:
Container.removeAllItems()

addItem

public Object addItem()
               throws UnsupportedOperationException
Creates a new item into container with container managed id. The id of the created new item is returned. The item can be fetched with getItem() method. if the creation fails, null is returned.

Specified by:
addItem in interface Container
Returns:
the Id of the created item or null in case of failure.
Throws:
UnsupportedOperationException
See Also:
Container.addItem()

addItem

public Item addItem(Object itemId)
             throws UnsupportedOperationException
Create a new item into container. The created new item is returned and ready for setting property values. if the creation fails, null is returned. In case the container already contains the item, null is returned. This functionality is optional. If the function is unsupported, it always returns null.

Specified by:
addItem in interface Container
Parameters:
itemId - the Identification of the item to be created.
Returns:
the Created item with the given id, or null in case of failure.
Throws:
UnsupportedOperationException
See Also:
Container.addItem(java.lang.Object)

removeItem

public boolean removeItem(Object itemId)
                   throws UnsupportedOperationException
Removes the item identified by Id from the container. This functionality is optional. If the function is not implemented, the functions allways returns false.

Specified by:
removeItem in interface Container
Parameters:
itemId - ID of the Item to remove
Returns:
True if the operation succeeded.
Throws:
UnsupportedOperationException
See Also:
Container.removeItem(java.lang.Object)

removeContainerProperty

public boolean removeContainerProperty(Object propertyId)
                                throws UnsupportedOperationException
Removes the property from all items. Removes a property with given id from all the items in the container. This functionality is optional. If the function is unsupported, it always returns false.

Specified by:
removeContainerProperty in interface Container
Parameters:
propertyId - ID of the Property to remove
Returns:
True if the operation succeeded.
Throws:
UnsupportedOperationException
See Also:
Container.removeContainerProperty(java.lang.Object)

setContainerDataSource

public void setContainerDataSource(Container newDataSource)
Sets the container as data-source for viewing.

Specified by:
setContainerDataSource in interface Container.Viewer
Parameters:
newDataSource - the new data source.

getContainerDataSource

public Container getContainerDataSource()
Gets the viewing data-source container.

Specified by:
getContainerDataSource in interface Container.Viewer
Returns:
data source Container
See Also:
Container.Viewer.getContainerDataSource()

isMultiSelect

public boolean isMultiSelect()
Is the select in multiselect mode? In multiselect mode

Returns:
the Value of property multiSelect.

setMultiSelect

public void setMultiSelect(boolean multiSelect)
Sets the multiselect mode. Setting multiselect mode false may loose selection information: if selected items set contains one or more selected items, only one of the selected items is kept as selected.

Parameters:
multiSelect - the New value of property multiSelect.

isNewItemsAllowed

public boolean isNewItemsAllowed()
Does the select allow adding new options by the user. If true, the new options can be added to the Container. The text entered by the user is used as id. No that data-source must allow adding new items (it must implement Container.Managed).

Returns:
True if additions are allowed.

setNewItemsAllowed

public void setNewItemsAllowed(boolean allowNewOptions)
Enables or disables possibility to add new options by the user.

Parameters:
allowNewOptions - the New value of property allowNewOptions.

setItemCaption

public void setItemCaption(Object itemId,
                           String caption)
Override the caption of an item. Setting caption explicitly overrides id, item and index captions.

Parameters:
itemId - the id of the item to be recaptioned.
caption - the New caption.

getItemCaption

public String getItemCaption(Object itemId)
Gets the caption of an item. The caption is generated as specified by the item caption mode. See setItemCaptionMode() for more details.

Parameters:
itemId - the id of the item to be queried.
Returns:
the caption for specified item.

setItemIcon

public void setItemIcon(Object itemId,
                        Resource icon)
Sets the icon for an item.

Parameters:
itemId - the id of the item to be assigned an icon.
icon - the New icon.

getItemIcon

public Resource getItemIcon(Object itemId)
Gets the item icon.

Parameters:
itemId - the id of the item to be assigned an icon.
Returns:
the Icon for the item or null, if not specified.

setItemCaptionMode

public void setItemCaptionMode(int mode)
Sets the item caption mode.

The mode can be one of the following ones:

The ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID is the default mode.

Parameters:
mode - the One of the modes listed above.

getItemCaptionMode

public int getItemCaptionMode()
Gets the item caption mode.

The mode can be one of the following ones:

The ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID is the default mode.

Returns:
the One of the modes listed above.

setItemCaptionPropertyId

public void setItemCaptionPropertyId(Object propertyId)
Sets the item caption property.

Setting the id to a existing property implicitly sets the item caption mode to ITEM_CAPTION_MODE_PROPERTY. If the object is in ITEM_CAPTION_MODE_PROPERTY mode, setting caption property id null resets the item caption mode to ITEM_CAPTION_EXPLICIT_DEFAULTS_ID.

Setting the property id to null disables this feature. The id is null by default

.

Parameters:
propertyId - the id of the property.

getItemCaptionPropertyId

public Object getItemCaptionPropertyId()
Gets the item caption property.

Returns:
the Id of the property used as item caption source.

setItemIconPropertyId

public void setItemIconPropertyId(Object propertyId)
Sets the item icon property.

If the property id is set to a valid value, each item is given an icon got from the given property of the items. The type of the property must be assignable to Icon.

Note : The icons set with setItemIcon function override the icons from the property.

Setting the property id to null disables this feature. The id is null by default

.

Parameters:
propertyId - the Id of the property that specifies icons for items.

getItemIconPropertyId

public Object getItemIconPropertyId()
Gets the item icon property.

If the property id is set to a valid value, each item is given an icon got from the given property of the items. The type of the property must be assignable to Icon.

Note : The icons set with setItemIcon function override the icons from the property.

Setting the property id to null disables this feature. The id is null by default

.

Returns:
the Id of the property containing the item icons.

isSelected

public boolean isSelected(Object itemId)
Tests if an item is selected.

In single select mode testing selection status of the item identified by getNullSelectionItemId() returns true if the value of the property is null.

Parameters:
itemId - the Id the of the item to be tested.
See Also:
getNullSelectionItemId(), setNullSelectionItemId(Object)

select

public void select(Object itemId)
Selects an item.

In single select mode selecting item identified by getNullSelectionItemId() sets the value of the property to null.

Parameters:
itemId - the tem to be selected.
See Also:
getNullSelectionItemId(), setNullSelectionItemId(Object)

unselect

public void unselect(Object itemId)
Unselects an item.

Parameters:
itemId - the Item to be unselected.
See Also:
getNullSelectionItemId(), setNullSelectionItemId(Object)

containerPropertySetChange

public void containerPropertySetChange(Container.PropertySetChangeEvent event)
Notifies this listener that the Containers contents has changed.

Specified by:
containerPropertySetChange in interface Container.PropertySetChangeListener
Parameters:
event - Change event.
See Also:
Container.PropertySetChangeListener.containerPropertySetChange(com.itmill.toolkit.data.Container.PropertySetChangeEvent)

addListener

public void addListener(Container.PropertySetChangeListener listener)
Adds a new Property set change listener for this Container.

Specified by:
addListener in interface Container.PropertySetChangeNotifier
Parameters:
listener - The new Listener to be registered
See Also:
Container.PropertySetChangeNotifier.addListener(com.itmill.toolkit.data.Container.PropertySetChangeListener)

removeListener

public void removeListener(Container.PropertySetChangeListener listener)
Removes a previously registered Property set change listener.

Specified by:
removeListener in interface Container.PropertySetChangeNotifier
Parameters:
listener - Listener to be removed
See Also:
Container.PropertySetChangeNotifier.removeListener(com.itmill.toolkit.data.Container.PropertySetChangeListener)

addListener

public void addListener(Container.ItemSetChangeListener listener)
Adds an Item set change listener for the object.

Specified by:
addListener in interface Container.ItemSetChangeNotifier
Parameters:
listener - listener to be added
See Also:
Container.ItemSetChangeNotifier.addListener(com.itmill.toolkit.data.Container.ItemSetChangeListener)

removeListener

public void removeListener(Container.ItemSetChangeListener listener)
Removes the Item set change listener from the object.

Specified by:
removeListener in interface Container.ItemSetChangeNotifier
Parameters:
listener - listener to be removed
See Also:
Container.ItemSetChangeNotifier.removeListener(com.itmill.toolkit.data.Container.ItemSetChangeListener)

containerItemSetChange

public void containerItemSetChange(Container.ItemSetChangeEvent event)
Lets the listener know a Containers Item set has changed.

Specified by:
containerItemSetChange in interface Container.ItemSetChangeListener
Parameters:
event - change event text
See Also:
Container.ItemSetChangeListener.containerItemSetChange(com.itmill.toolkit.data.Container.ItemSetChangeEvent)

firePropertySetChange

protected void firePropertySetChange()
Fires the property set change event.


fireItemSetChange

protected void fireItemSetChange()
Fires the item set change event.


getNullSelectionItemId

public final Object getNullSelectionItemId()
Returns the item id that represents null value of this select in single select mode.

Data interface does not support nulls as item ids. Selecting the item idetified by this id is the same as selecting no items at all. This setting only affects the single select mode.

Returns:
the Object Null value item id.
See Also:
setNullSelectionItemId(Object), isSelected(Object), select(Object)

setNullSelectionItemId

public void setNullSelectionItemId(Object nullSelectionItemId)
Sets the item id that represents null value of this select.

Data interface does not support nulls as item ids. Selecting the item idetified by this id is the same as selecting no items at all. This setting only affects the single select mode.

Parameters:
nullSelectionItemId - the nullSelectionItemId to set.
See Also:
getNullSelectionItemId(), isSelected(Object), select(Object)

isLazyLoading

public boolean isLazyLoading()

setLazyLoading

public void setLazyLoading(boolean useLazyLoading)

setLazyLoading

public void setLazyLoading(boolean useLazyLoading,
                           Application app,
                           Select.OptionsStream optionsStream)

attach

public void attach()
Notifies the component that it is connected to an application.

Specified by:
attach in interface Component
Overrides:
attach in class AbstractField
See Also:
AbstractField.attach()

detach

public void detach()
Detaches the component from application.

Specified by:
detach in interface Component
Overrides:
detach in class AbstractComponent
See Also:
AbstractComponent.detach()

setOptionFilter

public void setOptionFilter(OptionFilter of)

getOptionFilter

public OptionFilter getOptionFilter()
Returns:

escapeJSON

public static String escapeJSON(String s)


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.