|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.sap.ui.core.client.Element
com.sap.ui.core.client.Control
com.sap.ui.commons.client.ListBox
public class ListBox
The class ListBox is the GWT wrapper
for the Phoenix control: sap.ui.commons.ListBox.
Provides a list of items from which users can choose an item. For the design of the listbox, features such as defining the listbox height, fixing the number of visible items, choosing one item to be the item that is marked by default when the listbox is shown, or a scrollbar for large listboxes are available.
sap.ui.core.ListItems shall be displayed, or not.
| Constructor Summary | |
|---|---|
protected |
ListBox()
constructs the class ListBoxhidden due to JavaScriptObject restriction |
| Method Summary | |
|---|---|
ListBox |
addItem(com.sap.ui.core.client.Item item)
Appends a item to the aggregation items. |
void |
addSelectedIndex(int index)
Adds the given index to current selection. |
void |
addSelectedIndices(Integer[] indices)
Adds the given indices to selection. |
ListBox |
attachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
attach an EventListener
Event is fired when selection is changed by user interaction. |
void |
clearSelection()
Removes complete selection. |
static ListBox |
create()
creates a new instance of the class ListBox |
static ListBox |
create(String idOrConfig)
creates a new instance of the class ListBox |
static ListBox |
create(String id,
String config)
creates a new instance of the class ListBox |
ListBox |
destroyItems()
Destroys all the items in the Items-aggregation. |
ListBox |
detachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
detach an EventListener
Event is fired when selection is changed by user interaction. |
String |
getHeight()
Getter for property height
Control height as common CSS-size (px or % as unit, for example). |
com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> |
getItems()
Getter for aggregation items Aggregation of items to be displayed. |
String |
getMaxWidth()
Getter for property maxWidth
The maximum width of the ListBox. |
String |
getMinWidth()
Getter for property minWidth
The minimum width of the ListBox. |
int |
getScrollTop()
Getter for property scrollTop
Scrollbar position from the top. |
com.sap.ui.core.client.TextAlign |
getSecondaryValueTextAlign()
Getter for property secondaryValueTextAlign
The text alignment in the secondary (optional) text column of the ListBox. |
int |
getSelectedIndex()
Zero-based index of selected item. |
Integer[] |
getSelectedIndices()
Zero-based indices of selected items, wrapped in an array. |
com.sap.ui.core.client.Item |
getSelectedItem()
Returns selected item. |
com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> |
getSelectedItems()
Returns an array containing the selected items. |
com.sap.ui.core.client.TextAlign |
getValueTextAlign()
Getter for property valueTextAlign
The text alignment in the primary column of the ListBox. |
int |
getVisibleItems()
Getter for property visibleItems
The control height in number of items to be completely displayed without scrolling. |
String |
getWidth()
Getter for property width
Control width as common CSS-size (px or % as unit, for example). |
int |
indexOfItem(com.sap.ui.core.client.Item item)
Checks for the provided com.sap.ui.core.client.Item in the items-aggregation and
returns its index if found or -1 otherwise. |
ListBox |
insertItem(com.sap.ui.core.client.Item item,
int index)
Inserts some item into the aggregation named items. |
boolean |
isAllowMultiSelect()
Getter for property allowMultiSelect
Specifies whether multiple selection is allowed. |
boolean |
isDisplayIcons()
Getter for property displayIcons
Defines whether the icons of the list items should also be displayed. |
boolean |
isDisplaySecondaryValues()
Getter for property displaySecondaryValues
Indicates whether the additionalText property that can be set on sap.ui.core.ListItems shall be displayed, or not. |
boolean |
isEditable()
Getter for property editable
Value "true" makes the listbox interactive. |
boolean |
isEnabled()
Getter for property enabled
Disabled controls have another color display depending on custom settings. |
boolean |
isIndexSelected(int index)
Returns whether the given index is selected. |
boolean |
isVisible()
Getter for property visible
Invisible controls are not rendered. |
com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item>> |
removeAllItems()
Removes all the items in the items-aggregation. |
com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> |
removeItem(int index)
Removes a item from the aggregation named items. |
void |
removeSelectedIndex(int index)
Removes the given index from this selection. |
void |
scrollToIndex(int index,
boolean lazy)
If the ListBox has a scrollbar because the number of items is larger than the number of visible items, this method scrolls to the item with the given index. |
ListBox |
setAllowMultiSelect(boolean value)
Setter for property allowMultiSelectDefault value is: false |
ListBox |
setDisplayIcons(boolean value)
Setter for property displayIconsDefault value is: false |
ListBox |
setDisplaySecondaryValues(boolean value)
Setter for property displaySecondaryValuesDefault value is: false |
ListBox |
setEditable(boolean value)
Setter for property editableDefault value is: true |
ListBox |
setEnabled(boolean value)
Setter for property enabledDefault value is: true |
ListBox |
setHeight(String value)
Setter for property height |
ListBox |
setItems(com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.ListItem> items,
boolean destroyItems)
Allows setting the list items for this instance of ListBox as array. |
ListBox |
setMaxWidth(String value)
Setter for property maxWidth |
ListBox |
setMinWidth(String value)
Setter for property minWidth |
ListBox |
setScrollTop(int value)
Setter for property scrollTopDefault value is: -1 |
ListBox |
setSecondaryValueTextAlign(com.sap.ui.core.client.TextAlign value)
Setter for property secondaryValueTextAlignDefault value is: Begin |
void |
setSelectedIndex(int index)
Sets the zero-based index of the currently selected item. |
void |
setSelectedIndices(Integer[] indices)
Zero-based indices of selected items, wrapped in an array. |
ListBox |
setValueTextAlign(com.sap.ui.core.client.TextAlign value)
Setter for property valueTextAlignDefault value is: Begin |
ListBox |
setVisible(boolean value)
Setter for property visibleDefault value is: true |
ListBox |
setVisibleItems(int value)
Setter for property visibleItemsDefault value is: |
ListBox |
setWidth(String value)
Setter for property width |
| Methods inherited from class com.sap.ui.core.client.Control |
|---|
addStyleClass, hasStyleClass, invalidate, placeAt, placeAt, removeStyleClass, rerender |
| Methods inherited from class com.sap.ui.core.client.Element |
|---|
_convertArray, _convertArray, _convertArray, _convertArray, _convertArray, attachBrowserEvent, attachEvent, bindAggregation, bindContext, bindProperty, bindProperty, destroy, detachBrowserEvent, detachEvent, getDomRef, getElementName, getId, getLibraryName, getModel, getParent, getProperty, getTooltip_AsString, getTooltip_Text, getTooltip, isActive, setModel, setProperty, setTooltip, setTooltip, unbindAggregation, unbindContext, unbindProperty |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
|---|
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ListBox()
ListBoxJavaScriptObject restriction
| Method Detail |
|---|
public static ListBox create()
ListBox
public static ListBox create(String idOrConfig)
ListBox
id - id of the ListBox or configuration JSON string
public static ListBox create(String id,
String config)
ListBox
id - id of the ListBoxconfig - configuration JSON stringpublic final boolean isEditable()
editable
Value "true" makes the listbox interactive.
public final ListBox setEditable(boolean value)
editabletrue
value - boolean
this to allow method chainingpublic final boolean isEnabled()
enabled
Disabled controls have another color display depending on custom settings.
public final ListBox setEnabled(boolean value)
enabledtrue
value - boolean
this to allow method chainingpublic final boolean isAllowMultiSelect()
allowMultiSelect
Specifies whether multiple selection is allowed.
public final ListBox setAllowMultiSelect(boolean value)
allowMultiSelectfalse
value - boolean
this to allow method chainingpublic final boolean isVisible()
visible
Invisible controls are not rendered.
public final ListBox setVisible(boolean value)
visibletrue
value - boolean
this to allow method chainingpublic final String getWidth()
width
Control width as common CSS-size (px or % as unit, for example).
The setting overrides any definitions made for the setVisibleItems() method.
public final ListBox setWidth(String value)
width
value - String
this to allow method chainingpublic final String getHeight()
height
Control height as common CSS-size (px or % as unit, for example).
The setting overrides any definitions made for the setVisibleItems() method.
public final ListBox setHeight(String value)
height
value - String
this to allow method chainingpublic final int getScrollTop()
scrollTop
Scrollbar position from the top. Setting the scrollTop property and calling scrollToIndex are two operations influencing the same "physical" property, so the last call "wins".
public final ListBox setScrollTop(int value)
scrollTop-1
value - int
this to allow method chainingpublic final boolean isDisplayIcons()
displayIcons
Defines whether the icons of the list items should also be displayed. Enabling icons causes some space to be reserved for them, regardless of how many of the items actually have icons assigned. Displaying icons can also influence the width and height of a single item, which affects the height of the ListBox when it is defined in number of items. In particular with differently-sized icons the total ListBox height will not accomodte exactly the given number of items, then.
public final ListBox setDisplayIcons(boolean value)
displayIconsfalse
value - boolean
this to allow method chainingpublic final boolean isDisplaySecondaryValues()
displaySecondaryValues
Indicates whether the additionalText property that can be set on sap.ui.core.ListItems shall be displayed, or not.
public final ListBox setDisplaySecondaryValues(boolean value)
displaySecondaryValuesfalse
value - boolean
this to allow method chainingpublic final com.sap.ui.core.client.TextAlign getValueTextAlign()
valueTextAlign
The text alignment in the primary column of the ListBox.
public final ListBox setValueTextAlign(com.sap.ui.core.client.TextAlign value)
valueTextAlignBegin
value - com.sap.ui.core.client.TextAlign
this to allow method chainingpublic final com.sap.ui.core.client.TextAlign getSecondaryValueTextAlign()
secondaryValueTextAlign
The text alignment in the secondary (optional) text column of the ListBox.
public final ListBox setSecondaryValueTextAlign(com.sap.ui.core.client.TextAlign value)
secondaryValueTextAlignBegin
value - com.sap.ui.core.client.TextAlign
this to allow method chainingpublic final String getMinWidth()
minWidth
The minimum width of the ListBox. If not set, there is no minimum width.
public final ListBox setMinWidth(String value)
minWidth
value - String
this to allow method chainingpublic final String getMaxWidth()
maxWidth
The maximum width of the ListBox. If not set, there is no maximum width.
public final ListBox setMaxWidth(String value)
maxWidth
value - String
this to allow method chainingpublic final int getVisibleItems()
visibleItems
The control height in number of items to be completely displayed without scrolling. Setting this overwrites any height in terms of CSS size previously set. When items have different heights, the height of the first item is used for all calculations.
If between the visible ListBox items there are one or more separators, the specified number of items will not exactly fit.
If the value is retrieved it will equal the previously set value if it was set, otherwise it will be the number of items completely fitting into the ListBox without scrolling if the control was already rendered. If the control was not rendered, the behavior is undefined, it may return -1 or any other number.
public final ListBox setVisibleItems(int value)
visibleItems
value - int
this to allow method chainingpublic final com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> getItems()
public final ListBox insertItem(com.sap.ui.core.client.Item item,
int index)
items.
item - the item to insertindex - int the 0-based index the item should be inserted at.
this to allow method chainingpublic final ListBox addItem(com.sap.ui.core.client.Item item)
items.
item - com.sap.ui.core.client.Item the item to add
this to allow method chainingpublic final com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> removeItem(int index)
items.
index - int the position of the item to remove.
public final com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item>> removeAllItems()
public final int indexOfItem(com.sap.ui.core.client.Item item)
com.sap.ui.core.client.Item in the items-aggregation and
returns its index if found or -1 otherwise.
item - the item whose index is looked for.
public final ListBox destroyItems()
this to allow method chainingpublic final ListBox attachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
EventListener
Event is fired when selection is changed by user interaction.
listener - reference to the EventListener
this to allow method chainingpublic final ListBox detachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
EventListener
Event is fired when selection is changed by user interaction.
listener - reference to the EventListener
this to allow method chainingpublic final int getSelectedIndex()
public final void setSelectedIndex(int index)
index - Index to be selected.public final void addSelectedIndex(int index)
index - Index to add to selection.public final void removeSelectedIndex(int index)
index - Index that shall be removed from selection.public final Integer[] getSelectedIndices()
public final void setSelectedIndices(Integer[] indices)
indices - Indices of the items to be selected.public final void addSelectedIndices(Integer[] indices)
indices - Indices of the items that shall additionally be selected.public final boolean isIndexSelected(int index)
index - Index which is checked for selection state.public final com.sap.ui.core.client.Item getSelectedItem()
public final com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> getSelectedItems()
public final void clearSelection()
public final void scrollToIndex(int index,
boolean lazy)
index - The index to which the ListBox should scroll.lazy - If set to true, the ListBox only scrolls if the item is not completely visible, and it scrolls just enough to make it fully visible. If set to false (and by default), the item is scrolled to the top position if possible.
public final ListBox setItems(com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.ListItem> items,
boolean destroyItems)
items - The items to set for this ListBox.destroyItems - Optional boolean parameter to indicate that the formerly set items should be destroyed instead of just removed.
If omitted defaults to false, i.e. no not destroy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||