|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.WIconPair
public class WIconPair
A widget that shows one of two icons depending on its state.
This is a utility class that simply manages two images, only one of which is shown at a single time, which reflects the current 'state'.
The widget may react to click events, by changing state.
This widget does not provide styling, and can be styled using inline or
external CSS as appropriate. The image may be styled via the
<img> elements.
| Constructor Summary | |
|---|---|
WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI)
Construct an icon pair from the two icons. |
|
WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI,
boolean clickIsSwitch)
Construct an icon pair from the two icons. |
|
WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI,
boolean clickIsSwitch,
WContainerWidget parent)
Construct an icon pair from the two icons. |
|
| Method Summary | |
|---|---|
WImage |
getIcon1()
Returns the first icon image. |
WImage |
getIcon2()
Returns the second icon image. |
int |
getState()
Returns the current state. |
EventSignal1<WMouseEvent> |
icon1Clicked()
Signal emitted when clicked while in state 0 (icon 1 is shown). |
EventSignal1<WMouseEvent> |
icon2Clicked()
Signal emitted when clicked while in state 1 (icon 2 is shown). |
void |
setState(int num)
Sets the state, which determines the visible icon. |
void |
showIcon1()
Sets the state to 0 (show icon 1). |
void |
showIcon2()
Sets the state to 1 (show icon 2). |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, isRendered, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI,
boolean clickIsSwitch,
WContainerWidget parent)
The constructor takes the URL of the two icons. When
clickIsSwitch is set true, clicking on the icon
will switch state.
public WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI)
Calls
this(icon1URI, icon2URI, true, (WContainerWidget)null)
public WIconPair(java.lang.String icon1URI,
java.lang.String icon2URI,
boolean clickIsSwitch)
Calls
this(icon1URI, icon2URI, clickIsSwitch, (WContainerWidget)null)
| Method Detail |
|---|
public void setState(int num)
The first icon has number 0, and the second icon has number 1.
The default state is 0.
getState()public int getState()
setState(int num)public WImage getIcon1()
public WImage getIcon2()
public void showIcon1()
setState(int num)public void showIcon2()
setState(int num)public EventSignal1<WMouseEvent> icon1Clicked()
Equivalent to:
icon1().clicked()
public EventSignal1<WMouseEvent> icon2Clicked()
Equivalent to:
icon2().clicked()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||