|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractField
com.itmill.toolkit.ui.Button
public class Button
A generic button component.
Nested Class Summary | |
---|---|
class |
Button.ClickEvent
Click event. |
static interface |
Button.ClickListener
Button click listener |
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractField |
---|
AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Field Summary | |
---|---|
static String |
STYLE_LINK
|
Constructor Summary | |
---|---|
Button()
Creates a new push button. |
|
Button(String caption)
Creates a new push button. |
|
Button(String caption,
boolean initialState)
Creates a new switch button with initial value. |
|
Button(String caption,
Button.ClickListener listener)
Creates a new push button with click listener. |
|
Button(String caption,
Object target,
String methodName)
Creates a new push button with a method listening button clicks. |
|
Button(String caption,
Property dataSource)
Creates a new switch button that is connected to a boolean property. |
Method Summary | |
---|---|
void |
addListener(Button.ClickListener listener)
Adds the button click listener. |
boolean |
booleanValue()
Get the boolean value of the button state. |
void |
changeVariables(Object source,
Map variables)
Invoked when the value of a variable has changed. |
protected void |
fireClick()
Emits the options change event. |
String |
getTag()
Gets component UIDL tag. |
Class |
getType()
The type of the button as a property. |
boolean |
isSwitchMode()
Checks if it is switchMode. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
removeListener(Button.ClickListener listener)
Removes the button click listener. |
void |
setImmediate(boolean immediate)
Sets immediate mode. |
protected void |
setInternalValue(Object newValue)
Sets the internal field value. |
void |
setSwitchMode(boolean switchMode)
Sets the switchMode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.itmill.toolkit.ui.Field |
---|
getDescription, setCaption, setDescription |
Field Detail |
---|
public static final String STYLE_LINK
Constructor Detail |
---|
public Button()
public Button(String caption)
caption
- the Button caption.public Button(String caption, Button.ClickListener listener)
caption
- the Button caption.listener
- the Button click listener.public Button(String caption, Object target, String methodName)
Button(String, com.itmill.toolkit.ui.Button.ClickListener)
instead. The method must have either no parameters, or only one parameter
of Button.ClickEvent type.
caption
- the Button caption.target
- the Object having the method for listening button clicks.methodName
- the name of the method in target object, that receives button
click events.public Button(String caption, boolean initialState)
state
- the Initial state of the switch-button.initialState
- public Button(String caption, Property dataSource)
state
- the Initial state of the switch-button.dataSource
- Method Detail |
---|
public String getTag()
getTag
in class AbstractComponent
public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractField
event
- the PaintEvent.
IOException
- if the writing failed due to input/output error.
PaintException
- if the paint operation failed.public void changeVariables(Object source, Map variables)
changeVariables
in interface VariableOwner
changeVariables
in class AbstractField
source
- variables
- public boolean isSwitchMode()
true
if it is in Switch Mode, otherwise
false
.public void setSwitchMode(boolean switchMode)
switchMode
- The switchMode to set.public boolean booleanValue()
public void setImmediate(boolean immediate)
setImmediate
in class AbstractComponent
immediate
- the boolean value specifying if the component should be in the
immediate mode after the call.AbstractComponent.setImmediate(boolean)
public Class getType()
getType
in interface Property
getType
in class AbstractField
Property.getType()
public void addListener(Button.ClickListener listener)
listener
- the Listener to be added.public void removeListener(Button.ClickListener listener)
listener
- the Listener to be removed.protected void fireClick()
protected void setInternalValue(Object newValue)
AbstractField
setInternalValue
in class AbstractField
newValue
- the new value to be set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |