| |
|
| java.lang.Object org.millstone.base.ui.AbstractComponent org.millstone.base.ui.AbstractField org.millstone.base.ui.Select
All known Subclasses: org.millstone.base.ui.Tree, org.millstone.base.ui.Table,
Constructor Summary | |
public | Select() Creates an empty Select. | public | Select(String caption) Creates an empty Select with caption. | public | Select(String caption, Container dataSource) Creates a new select wthat is connected to a data-source. | public | Select(String caption, Collection options) Creates a new select that is filled from a collection of option values. |
Method Summary | |
public boolean | addContainerProperty(Object propertyId, Class type, Object defaultValue) Add 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. | public Object | addItem() Create a new item into container with container managed id.
The id of the created new item is returned. | public Item | addItem(Object itemId) 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. | public void | addListener(Container.PropertySetChangeListener listener) | public void | addListener(Container.ItemSetChangeListener listener) | public void | changeVariables(Object source, Map variables) Invoked when the value of a variable has changed. | public void | containerItemSetChange(Container.ItemSetChangeEvent event) | public void | containerPropertySetChange(Container.PropertySetChangeEvent event) | public boolean | containsId(Object itemId) Test, if the collection contains an item with given id. | protected void | fireItemSetChange() | protected void | firePropertySetChange() | public Container | getContainerDataSource() Get viewing data-source container. | public Property | getContainerProperty(Object itemId, Object propertyId) | public Collection | getContainerPropertyIds() Get property Id collection from the container. | public Item | getItem(Object itemId) Get the item from the container with given id. | public String | getItemCaption(Object itemId) Get the caption of an item.
The caption is generated as specified by the item caption mode. | public int | getItemCaptionMode() Get the item caption mode.
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID : Items
Id-objects toString() is used as item caption. | public Object | getItemCaptionPropertyId() Get the item caption property. | public Resource | getItemIcon(Object itemId) Get the item icon.
Parameters: itemId - The id of the item to be assigned an icon. | public Object | getItemIconPropertyId() Get 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. | public Collection | getItemIds() Get item Id collection from the container. | final public 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. | public String | getTag() Get component UIDL tag. | public Class | getType() Return the type of the property. | public Class | getType(Object propertyId) Get property type. | public Object | getValue() Get the selected item id or in multiselect mode a set of selected ids. | public Collection | getVisibleItemIds() Get the visible item ids. | public boolean | isMultiSelect() | public boolean | isNewItemsAllowed() Does the select allow adding new options by the user.
If true, the new options can be added to the Container. | public boolean | isSelected(Object itemId) | public void | paintContent(PaintTarget target) Paint the content of this component. | public boolean | removeAllItems() Remove all items from the container.
This functionality is optional. | public boolean | removeContainerProperty(Object propertyId) Remove property from all items.
Removes a property with given id from all the items in the container.
This functionality is optional. | public boolean | removeItem(Object itemId) Remove item identified by Id from the container.
This functionality is optional. | public void | removeListener(Container.PropertySetChangeListener listener) | public void | removeListener(Container.ItemSetChangeListener listener) | public void | select(Object itemId) Select an item. | public void | setContainerDataSource(Container newDataSource) Set the container as data-source for viewing. | public void | setItemCaption(Object itemId, String caption) Override the caption of an item. | public void | setItemCaptionMode(int mode) Set the item caption mode.
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID : Items
Id-objects toString() is used as item caption. | public void | setItemCaptionPropertyId(Object propertyId) Set 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. | public void | setItemIcon(Object itemId, Resource icon) Set icon for an item. | public void | setItemIconPropertyId(Object propertyId) Set 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. | public void | setMultiSelect(boolean multiSelect) Set the multiselect mode. | public void | setNewItemsAllowed(boolean allowNewOptions) Enable or disable possibility to add new options by the user. | 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. | public void | setValue(Object newValue) Set the visible value of the property.
The value of the select is the selected item id. | public int | size() Get the number of items in the container. | public void | unselect(Object itemId) Unselect an item. |
ITEM_CAPTION_MODE_EXPLICIT | final public static int ITEM_CAPTION_MODE_EXPLICIT(Code) | | Item caption mode: Captions must be explicitly specified.
|
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID | final public static int ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID(Code) | | 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.
|
ITEM_CAPTION_MODE_ICON_ONLY | final public static int ITEM_CAPTION_MODE_ICON_ONLY(Code) | | Item caption mode: Only icons are shown, captions are hidden.
|
ITEM_CAPTION_MODE_ID | final public static int ITEM_CAPTION_MODE_ID(Code) | | Item caption mode: Item's ID's String representation
is used as caption.
|
ITEM_CAPTION_MODE_INDEX | final public static int ITEM_CAPTION_MODE_INDEX(Code) | | Item caption mode: Index of the item is used as caption. The
index mode can only be used with the containers implementing the
org.millstone.base.data.Container.Indexed interface.
|
ITEM_CAPTION_MODE_ITEM | final public static int ITEM_CAPTION_MODE_ITEM(Code) | | Item caption mode: Item's String representation is
used as caption.
|
ITEM_CAPTION_MODE_PROPERTY | final public static int ITEM_CAPTION_MODE_PROPERTY(Code) | | Item caption mode: Item captions are read from property specified
with setItemCaptionPropertyId .
|
itemIdMapper | protected KeyMapper itemIdMapper(Code) | | Keymapper used to map key values
|
Select | public Select()(Code) | | Creates an empty Select.
The caption is not used.
|
Select | public Select(String caption)(Code) | | Creates an empty Select with caption.
|
Select | public Select(String caption, Container dataSource)(Code) | | Creates a new select wthat is connected to a data-source.
Parameters: dataSource - Container datasource to be selected from by this select. Parameters: caption - Caption of the component. Parameters: selected - Selected item id or null, if none selected. |
Select | public Select(String caption, Collection options)(Code) | | Creates a new select that is filled from a collection of option values.
Parameters: caption - Caption of this field. Parameters: options - Collection containing the options. Parameters: selected - Selected option or null, if none selected. |
addContainerProperty | public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException(Code) | | Add 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.
True iff the operation succeeded. |
addItem | public Object addItem() throws UnsupportedOperationException(Code) | | Create 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.
Id of the created item or null in case of failure. |
addItem | public Item addItem(Object itemId) throws UnsupportedOperationException(Code) | | 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.
Parameters: itemId - Identification of the item to be created. Created item with the given id, or null in case of failure. |
addListener | public void addListener(Container.PropertySetChangeListener listener)(Code) | | See Also: org.millstone.base.data.Container.PropertySetChangeNotifier.addListener(org.millstone.base.data.Container.PropertySetChangeListener) |
addListener | public void addListener(Container.ItemSetChangeListener listener)(Code) | | See Also: org.millstone.base.data.Container.ItemSetChangeNotifier.addListener(org.millstone.base.data.Container.ItemSetChangeListener) |
changeVariables | public void changeVariables(Object source, Map variables)(Code) | | Invoked when the value of a variable has changed.
Parameters: event - Variable change event containing the information aboutthe changed variable. |
containerItemSetChange | public void containerItemSetChange(Container.ItemSetChangeEvent event)(Code) | | See Also: org.millstone.base.data.Container.ItemSetChangeListener.containerItemSetChange(org.millstone.base.data.Container.ItemSetChangeEvent) |
containerPropertySetChange | public void containerPropertySetChange(Container.PropertySetChangeEvent event)(Code) | | See Also: org.millstone.base.data.Container.PropertySetChangeListener.containerPropertySetChange(org.millstone.base.data.Container.PropertySetChangeEvent) |
containsId | public boolean containsId(Object itemId)(Code) | | Test, if the collection contains an item with given id.
Parameters: itemId - Id the of item to be tested. |
fireItemSetChange | protected void fireItemSetChange()(Code) | | Fire item set change event
|
firePropertySetChange | protected void firePropertySetChange()(Code) | | Fire property set change event
|
getContainerDataSource | public Container getContainerDataSource()(Code) | | Get viewing data-source container.
|
getContainerPropertyIds | public Collection getContainerPropertyIds()(Code) | | Get property Id collection from the container.
Collection of property ids. |
getItem | public Item getItem(Object itemId)(Code) | | Get the item from the container with given id.
If the container does not contain the requested item, null is returned.
|
getItemCaption | public String getItemCaption(Object itemId)(Code) | | Get 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. caption for specified item. |
getItemCaptionMode | public int getItemCaptionMode()(Code) | | Get the item caption mode.
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID : Items
Id-objects toString() is used as item caption. If
caption is explicitly specified, it overrides the id-caption.
ITEM_CAPTION_MODE_ID : Items Id-objects
toString() is used as item caption.
ITEM_CAPTION_MODE_ITEM : Item-objects
toString() is used as item caption.
ITEM_CAPTION_MODE_INDEX : The index of the item is
used as item caption. The index mode can
only be used with the containers implementing
Container.Indexed interface.
ITEM_CAPTION_MODE_EXPLICIT : The item captions
must be explicitly specified.
ITEM_CAPTION_MODE_PROPERTY : The item captions
are read from property, that must be specified with
setItemCaptionPropertyId() .
The ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID is the default
mode.
One of the modes listed above. |
getItemCaptionPropertyId | public Object getItemCaptionPropertyId()(Code) | | Get the item caption property.
Id of the property used as item caption source. |
getItemIcon | public Resource getItemIcon(Object itemId)(Code) | | Get the item icon.
Parameters: itemId - The id of the item to be assigned an icon. Icon for the item or null, if not specified. |
getItemIconPropertyId | public Object getItemIconPropertyId()(Code) | | Get 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 that 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 .
Id of the property containing the item icons. |
getItemIds | public Collection getItemIds()(Code) | | Get item Id collection from the container.
Collection of item ids. |
getNullSelectionItemId | final public Object getNullSelectionItemId()(Code) | | 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.
Object Null value item id. See Also: Select.setNullSelectionItemId(Object) See Also: Select.isSelected(Object) See Also: Select.select(Object) |
getTag | public String getTag()(Code) | | Get component UIDL tag.
Component UIDL tag as string. |
getType | public Class getType()(Code) | | Return the type of the property.
getValue and setValue functions 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().
type Type of the property. |
getType | public Class getType(Object propertyId)(Code) | | Get property type.
Parameters: id - Id identifying the of the property. |
getValue | public Object getValue()(Code) | | Get the selected item id or in multiselect mode a set of selected ids.
|
getVisibleItemIds | public Collection getVisibleItemIds()(Code) | | Get 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.
|
isMultiSelect | public boolean isMultiSelect()(Code) | | Is the select in multiselect mode? In multiselect mode
Value of property multiSelect. |
isNewItemsAllowed | public boolean isNewItemsAllowed()(Code) | | 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).
True iff additions are allowed. |
removeAllItems | public boolean removeAllItems() throws UnsupportedOperationException(Code) | | Remove all items from the container.
This functionality is optional. If the function is unsupported, it always
returns false.
True iff the operation succeeded. |
removeContainerProperty | public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException(Code) | | Remove 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.
True iff the operation succeeded. |
removeItem | public boolean removeItem(Object itemId) throws UnsupportedOperationException(Code) | | Remove item identified by Id from the container.
This functionality is optional. If the function is not implemented,
the functions allways returns false.
True iff the operation succeeded. |
removeListener | public void removeListener(Container.PropertySetChangeListener listener)(Code) | | See Also: org.millstone.base.data.Container.PropertySetChangeNotifier.removeListener(org.millstone.base.data.Container.PropertySetChangeListener) |
removeListener | public void removeListener(Container.ItemSetChangeListener listener)(Code) | | See Also: org.millstone.base.data.Container.ItemSetChangeNotifier.removeListener(org.millstone.base.data.Container.ItemSetChangeListener) |
setContainerDataSource | public void setContainerDataSource(Container newDataSource)(Code) | | Set the container as data-source for viewing.
|
setItemCaption | public void setItemCaption(Object itemId, String caption)(Code) | | 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. Parameters: caption - New caption. |
setItemCaptionMode | public void setItemCaptionMode(int mode)(Code) | | Set the item caption mode.
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID : Items
Id-objects toString() is used as item caption. If
caption is explicitly specified, it overrides the id-caption.
ITEM_CAPTION_MODE_ID : Items Id-objects
toString() is used as item caption.
ITEM_CAPTION_MODE_ITEM : Item-objects
toString() is used as item caption.
ITEM_CAPTION_MODE_INDEX : The index of the item is
used as item caption. The index mode can
only be used with the containers implementing
Container.Indexed interface.
ITEM_CAPTION_MODE_EXPLICIT : The item captions
must be explicitly specified.
ITEM_CAPTION_MODE_PROPERTY : The item captions
are read from property, that must be specified with
setItemCaptionPropertyId() .
The ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID is the default
mode.
Parameters: mode - One of the modes listed above. |
setItemCaptionPropertyId | public void setItemCaptionPropertyId(Object propertyId)(Code) | | Set 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 .
|
setItemIcon | public void setItemIcon(Object itemId, Resource icon)(Code) | | Set icon for an item.
Parameters: itemId - The id of the item to be assigned an icon. Parameters: icon - New icon. |
setItemIconPropertyId | public void setItemIconPropertyId(Object propertyId)(Code) | | Set 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 that 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 - Id of the property that specifies icons foritems. |
setMultiSelect | public void setMultiSelect(boolean multiSelect)(Code) | | Set 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 - New value of property multiSelect. |
setNewItemsAllowed | public void setNewItemsAllowed(boolean allowNewOptions)(Code) | | Enable or disable possibility to add new options by the user.
Parameters: allowNewOptions - New value of property allowNewOptions. |
setNullSelectionItemId | public void setNullSelectionItemId(Object nullSelectionItemId)(Code) | | 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: nullPropertyValueContainerItemId - The nullPropertyValueContainerItemId to set See Also: Select.getNullSelectionItemId() See Also: Select.isSelected(Object) See Also: Select.select(Object) |
setValue | public void setValue(Object newValue) throws Property.ReadOnlyException, Property.ConversionException(Code) | | Set 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.
Parameters: newValue - New selected item or collection of selected items. |
size | public int size()(Code) | | Get the number of items in the container.
Number of items in the container. |
Methods inherited from org.millstone.base.ui.AbstractComponent | public void addListener(RepaintRequestListener listener)(Code)(Java Doc) public void addListener(Class eventType, Object object, Method method)(Code)(Java Doc) public void addListener(Class eventType, Object object, String methodName)(Code)(Java Doc) public void addListener(Component.Listener listener)(Code)(Java Doc) public void attach()(Code)(Java Doc) public void changeVariables(Object source, Map variables)(Code)(Java Doc) public void childRequestedRepaint(Collection alreadyNotified)(Code)(Java Doc) public void dependsOn(VariableOwner depended)(Code)(Java Doc) public void detach()(Code)(Java Doc) protected void fireComponentErrorEvent()(Code)(Java Doc) protected void fireComponentEvent()(Code)(Java Doc) protected void fireEvent(Component.Event event)(Code)(Java Doc) public Application getApplication()(Code)(Java Doc) public String getCaption()(Code)(Java Doc) public ErrorMessage getComponentError()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public String getDescription()(Code)(Java Doc) public Set getDirectDependencies()(Code)(Java Doc) public ErrorMessage getErrorMessage()(Code)(Java Doc) public Resource getIcon()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Component getParent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) abstract public String getTag()(Code)(Java Doc) public Window getWindow()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isReadOnly()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) final public void paint(PaintTarget target) throws PaintException(Code)(Java Doc) public void paintContent(PaintTarget target) throws PaintException(Code)(Java Doc) public void removeDirectDependency(VariableOwner depended)(Code)(Java Doc) public void removeListener(RepaintRequestListener listener)(Code)(Java Doc) public void removeListener(Class eventType, Object target)(Code)(Java Doc) public void removeListener(Class eventType, Object target, Method method)(Code)(Java Doc) public void removeListener(Class eventType, Object target, String methodName)(Code)(Java Doc) public void removeListener(Component.Listener listener)(Code)(Java Doc) public void requestRepaint()(Code)(Java Doc) public void requestRepaintRequests()(Code)(Java Doc) public void setCaption(String caption)(Code)(Java Doc) public void setComponentError(ErrorMessage componentError)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setDescription(String description)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setIcon(Resource icon)(Code)(Java Doc) public void setImmediate(boolean immediate)(Code)(Java Doc) public void setLocale(Locale locale)(Code)(Java Doc) public void setParent(Component parent)(Code)(Java Doc) public void setReadOnly(boolean readOnly)(Code)(Java Doc) public void setStyle(String style)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc)
|
|
|
|