|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object zk.Object zk.Widget zul.Widget zul.mesh.MeshWidget zul.sel.SelectWidget
public class SelectWidget
A skeletal implementation for a select widget.
Field Summary | |
---|---|
boolean |
rightSelect
Whether to change a list item selection on right click Default: true (unless the server changes the setting) |
Fields inherited from class zk.Widget |
---|
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName |
Fields inherited from class zk.Object |
---|
$class, $oid |
Method Summary | |
---|---|
void |
clearSelection()
Clears the selection. |
void |
fireOnSelect(Widget ref)
Fires the onSelect event. |
protected void |
fixAnchor_(int[] offs)
May need fix anchor. |
String |
getName()
Returns the name of this component. |
int |
getRows()
Returns the rows. |
int |
getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected). |
ItemWidget |
getSelectedItem()
Returns the selected item. |
Array |
getSelectedItems()
Returns all selected items. |
int |
indexOfItem(ItemWidget item)
Returns the index of the ItemWidget |
boolean |
isCheckmark()
Returns whether the check mark shall be displayed in front of each item. |
boolean |
isMultiple()
Returns whether multiple selections are allowed. |
void |
selectAll(boolean notify,
Event evt)
Selects all items. |
void |
selectItem(ItemWidget item)
Deselects all of the currently selected items and selects the given item. |
void |
setCheckmark(boolean checkmark)
Sets whether the check mark shall be displayed in front of each item. |
void |
setMultiple(boolean multiple)
Sets whether multiple selections are allowed. |
void |
setName(String name)
Sets the name of this component. |
void |
setRows(int rows)
Sets the rows. |
void |
setSelectAll(boolean notify,
Event evt)
Selects all items. |
void |
setSelectedIndex(int selectedIndex)
Deselects all of the currently selected items and selects the item with the given index. |
void |
setSelectedItem(ItemWidget item)
Deselects all of the currently selected items and selects the given item. |
protected int |
shallIgnoreSelect_(Event evt,
ItemWidget row)
Returns whether to ignore the selection. |
Methods inherited from class zul.mesh.MeshWidget |
---|
calcSize, getActivePage, getFocusCell, getHeadWidget, getInnerWidth, getPageCount, getPageSize, getPaginal, getPagingPosition, getSpan, inPagingMold, isAutopaging, isModel, isSizedByContent, setActivePage, setAutopaging, setInnerWidth, setModel, setPageSize, setPaginal, setPagingPosition, setSizedByContent, setSpan, syncSize |
Methods inherited from class zul.Widget |
---|
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class zk.Object |
---|
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean rightSelect
Default: true (unless the server changes the setting)
Method Detail |
---|
public void setRows(int rows)
Note: if both Widget.setHeight(_global_.String)
is specified with non-empty,
setRows(int)
is ignored
rows
- public int getRows()
Default: 0.
public void setCheckmark(boolean checkmark)
The check mark is a checkbox if isMultiple()
returns true. It is a
radio button if isMultiple()
returns false.
checkmark
- public boolean isCheckmark()
Default: false.
public void setMultiple(boolean multiple)
multiple
- public boolean isMultiple()
Default: false.
public void setSelectedIndex(int selectedIndex)
selectedIndex
- public int getSelectedIndex()
public void setName(String name)
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
name
- the name of this component.public String getName()
Default: null.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
public void setSelectedItem(ItemWidget item)
It is the same as selectItem(zul.sel.ItemWidget)
.
item
- public ItemWidget getSelectedItem()
public Array getSelectedItems()
public int indexOfItem(ItemWidget item)
item
-
public void selectItem(ItemWidget item)
It is the same as setSelectedItem(zul.sel.ItemWidget)
.
item
- the item to select. If null, all items are deselected.public void clearSelection()
protected void fixAnchor_(int[] offs)
offs
- The anchor offset [left, top]public void fireOnSelect(Widget ref)
ref
- the reference which causes this onSelect event.
Ignored if null.protected int shallIgnoreSelect_(Event evt, ItemWidget row)
Widget.doSelect_(zk.Event)
).
Default: always false (don't ignore) unless rightSelect
is true and event is onRightClick.
Notice that clicking on button/textbox are already ignored, i.e.,
this method won't be called if the user clicks on, say, a button.
evt
- the eventrow
- the row about to be selected
public void setSelectAll(boolean notify, Event evt)
notify
- if true, fire onSelect event to serverevt
- public void selectAll(boolean notify, Event evt)
notify
- if true, fire onSelect event to serverevt
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |