|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.sap.ui.core.client.ControlWidget
com.sap.ui.commons.client.ListBoxWidget
public class ListBoxWidget
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
|
ListBoxWidget()
constructs the class ListBoxWidget |
protected |
ListBoxWidget(ListBox control)
constructs the class ListBoxWidget |
|
ListBoxWidget(String id)
constructs the class ListBoxWidget |
| Method Summary | |
|---|---|
void |
addItem(com.sap.ui.core.client.Item item)
Appends some item to the items-aggregation. |
void |
addSelectedIndex(int index)
Adds the given index to current selection. |
void |
addSelectedIndices(Integer[] indices)
Adds the given indices to selection. |
void |
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. |
void |
destroyItems()
Destroys all the items in the Items-aggregation. |
void |
detachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
detach an EventListener
Event is fired when selection is changed by user interaction. |
ListBox |
getControl()
returns the reference to the Phoenix Control |
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. |
void |
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. |
void |
removeAllItems()
Removes all the items in the items-aggregation. |
void |
removeItem(int index)
Removes the item at position index in the items-aggregation named. |
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. |
void |
setAllowMultiSelect(boolean value)
Setter for property allowMultiSelectDefault value is: false |
void |
setDisplayIcons(boolean value)
Setter for property displayIconsDefault value is: false |
void |
setDisplaySecondaryValues(boolean value)
Setter for property displaySecondaryValuesDefault value is: false |
void |
setEditable(boolean value)
Setter for property editableDefault value is: true |
void |
setEnabled(boolean value)
Setter for property enabledDefault value is: true |
void |
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. |
void |
setMaxWidth(String value)
Setter for property maxWidth |
void |
setMinWidth(String value)
Setter for property minWidth |
void |
setScrollTop(int value)
Setter for property scrollTopDefault value is: -1 |
void |
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. |
void |
setValueTextAlign(com.sap.ui.core.client.TextAlign value)
Setter for property valueTextAlignDefault value is: Begin |
void |
setVisible(boolean value)
Setter for property visibleDefault value is: true |
void |
setVisibleItems(int value)
Setter for property visibleItemsDefault value is: |
void |
setWidth(String value)
Setter for property width |
| Methods inherited from class com.sap.ui.core.client.ControlWidget |
|---|
destroy, doAttachChildren, doDetachChildren, isDesignTime, wrap |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ListBoxWidget()
ListBoxWidget
public ListBoxWidget(String id)
ListBoxWidget
id - id of the ListBoxWidgetprotected ListBoxWidget(ListBox control)
ListBoxWidget
control - reference to an existing ListBox| Method Detail |
|---|
public ListBox getControl()
Control
getControl in class com.sap.ui.core.client.ControlWidgetControlpublic boolean isEditable()
editable
Value "true" makes the listbox interactive.
public void setEditable(boolean value)
editabletrue
value - booleanpublic boolean isEnabled()
enabled
Disabled controls have another color display depending on custom settings.
public void setEnabled(boolean value)
enabledtrue
value - booleanpublic boolean isAllowMultiSelect()
allowMultiSelect
Specifies whether multiple selection is allowed.
public void setAllowMultiSelect(boolean value)
allowMultiSelectfalse
value - booleanpublic boolean isVisible()
visible
Invisible controls are not rendered.
isVisible in class com.google.gwt.user.client.ui.UIObjectpublic void setVisible(boolean value)
visibletrue
setVisible in class com.google.gwt.user.client.ui.UIObjectvalue - booleanpublic 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 void setWidth(String value)
width
setWidth in class com.google.gwt.user.client.ui.UIObjectvalue - Stringpublic 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 void setHeight(String value)
height
setHeight in class com.google.gwt.user.client.ui.UIObjectvalue - Stringpublic 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 void setScrollTop(int value)
scrollTop-1
value - intpublic 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 void setDisplayIcons(boolean value)
displayIconsfalse
value - booleanpublic boolean isDisplaySecondaryValues()
displaySecondaryValues
Indicates whether the additionalText property that can be set on sap.ui.core.ListItems shall be displayed, or not.
public void setDisplaySecondaryValues(boolean value)
displaySecondaryValuesfalse
value - booleanpublic com.sap.ui.core.client.TextAlign getValueTextAlign()
valueTextAlign
The text alignment in the primary column of the ListBox.
public void setValueTextAlign(com.sap.ui.core.client.TextAlign value)
valueTextAlignBegin
value - com.sap.ui.core.client.TextAlignpublic com.sap.ui.core.client.TextAlign getSecondaryValueTextAlign()
secondaryValueTextAlign
The text alignment in the secondary (optional) text column of the ListBox.
public void setSecondaryValueTextAlign(com.sap.ui.core.client.TextAlign value)
secondaryValueTextAlignBegin
value - com.sap.ui.core.client.TextAlignpublic String getMinWidth()
minWidth
The minimum width of the ListBox. If not set, there is no minimum width.
public void setMinWidth(String value)
minWidth
value - Stringpublic String getMaxWidth()
maxWidth
The maximum width of the ListBox. If not set, there is no maximum width.
public void setMaxWidth(String value)
maxWidth
value - Stringpublic 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 void setVisibleItems(int value)
visibleItems
value - intpublic com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> getItems()
public void insertItem(com.sap.ui.core.client.Item item,
int index)
item - the item to insertindex - int the 0-based index the item should be inserted at.public void addItem(com.sap.ui.core.client.Item item)
item - com.sap.ui.core.client.Item the item to addpublic void removeItem(int index)
index in the items-aggregation named.
index - int the position of the item to remove.public void removeAllItems()
public 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 void destroyItems()
public void attachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
EventListener
Event is fired when selection is changed by user interaction.
listener - reference to the EventListenerpublic void detachSelectEvent(com.sap.ui.core.client.event.EventListener listener)
EventListener
Event is fired when selection is changed by user interaction.
listener - reference to the EventListenerpublic int getSelectedIndex()
public void setSelectedIndex(int index)
index - Index to be selected.public void addSelectedIndex(int index)
index - Index to add to selection.public void removeSelectedIndex(int index)
index - Index that shall be removed from selection.public Integer[] getSelectedIndices()
public void setSelectedIndices(Integer[] indices)
indices - Indices of the items to be selected.public void addSelectedIndices(Integer[] indices)
indices - Indices of the items that shall additionally be selected.public boolean isIndexSelected(int index)
index - Index which is checked for selection state.public com.sap.ui.core.client.Item getSelectedItem()
public com.sap.ui.core.client.js.JsArray<com.sap.ui.core.client.Item> getSelectedItems()
public void clearSelection()
public 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 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 | |||||||||