|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
net.sf.jzeno.echo.components.CustomComponent
net.sf.jzeno.echo.databinding.DynaCheckBox
public class DynaCheckBox
Checkbox that can be bound to a boolean (primitive) or
Boolean
(object) property.
Field Summary | |
---|---|
static int |
BOTTOM
|
static int |
CENTER
|
static int |
LEFT
|
static int |
RIGHT
|
static int |
TOP
|
Constructor Summary | |
---|---|
DynaCheckBox()
Creates an unbound component. |
|
DynaCheckBox(java.lang.Class beanClass,
java.lang.String propertyName,
java.lang.String constructionHints)
Creates a databound checkbox. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Invoked when an action occurs. |
void |
applyContext()
|
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style
object. |
java.lang.String |
getCssClass()
|
java.lang.String |
getCssClassDisabled()
|
Font |
getFont()
Returns the font. |
int |
getStateMargin()
|
java.lang.String |
getText()
Gets the label that appears after the checkbox. |
java.lang.String |
getToolTipText()
Gets the tooltip that appears when the user hoovers over the checkbox. |
boolean |
isAsync()
|
boolean |
isReadOnly()
Returns whether or not this checkbox is read-only. |
boolean |
isSelected()
Deprecated. read the boolean property you've bound this checkbox to. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Used internally. |
void |
rebind()
This operation causes the component to reset it's content to that of the domain model. |
void |
setActionCommand(java.lang.String command)
|
void |
setAsync(boolean async)
|
void |
setCssClass(java.lang.String cssClass)
|
void |
setCssClassDisabled(java.lang.String cssClass)
|
void |
setFocused(boolean focused)
Sets the input focus on this component |
void |
setFont(Font font)
Sets the font of the component. |
void |
setReadOnly(boolean readOnly)
Sets whether or not this checkbox is read-only. |
void |
setSelected(boolean selected)
Deprecated. write to the boolean property you've bound this checkbox to. |
void |
setStateMargin(int i)
Sets the size of the margin to be displayed between the state indicator of the toggle button and its icon and text. |
void |
setText(java.lang.String text)
Sets the label that appears after the checkbox. |
void |
setToolTipText(java.lang.String tip)
Sets the tooltip that appears when the user hoovers over the checkbox. |
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent |
---|
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setRequired, setValue, traceValue, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jzeno.echo.EventSource |
---|
getActionCommand |
Field Detail |
---|
public static final int TOP
public static final int CENTER
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
Constructor Detail |
---|
public DynaCheckBox()
Creates an unbound component.
public DynaCheckBox(java.lang.Class beanClass, java.lang.String propertyName, java.lang.String constructionHints)
Creates a databound checkbox. You should bind it to a boolean or Boolean property.
Method Detail |
---|
public void rebind()
RebindableComponent
This operation causes the component to reset it's content to that of the domain model.
rebind
in interface RebindableComponent
rebind
in class CustomComponent
public void propertyChange(java.beans.PropertyChangeEvent evt)
Used internally.
propertyChange
in interface java.beans.PropertyChangeListener
public boolean isReadOnly()
Returns whether or not this checkbox is read-only. If a checkbox is read-only it only visualizes the boolean it is bound to, but the user can not change the state of the checkbox.
isReadOnly
in interface PropertyComponent
isReadOnly
in class CustomComponent
public void setReadOnly(boolean readOnly)
Sets whether or not this checkbox is read-only. If a checkbox is read-only it only visualizes the boolean it is bound to, but the user can not change the state of the checkbox. The checkbox will be disabled.
It is also possible to specify the same, with inverse logic, through the enabled property. This method is needed because all PropertyComponent implementations must support it.
setReadOnly
in interface PropertyComponent
setReadOnly
in class CustomComponent
public void setText(java.lang.String text)
Sets the label that appears after the checkbox.
public java.lang.String getText()
Gets the label that appears after the checkbox.
public void setToolTipText(java.lang.String tip)
Sets the tooltip that appears when the user hoovers over the checkbox.
public java.lang.String getToolTipText()
Gets the tooltip that appears when the user hoovers over the checkbox.
public void setSelected(boolean selected)
Sets the selection state of the checkbox. The same effect can be achieved by changing the boolean property that this checkbox is bound to. We advise you to do this, instead of using the setSelected method.
public boolean isSelected()
Gets the selection state of the checkbox. The same effect can be achieved by reading the boolean property that this checkbox is bound to. We advise you to do this, instead of using the isSelected method.
public void setFocused(boolean focused)
Sets the input focus on this component
setFocused
in interface Component
setFocused
in class AbstractComponent
focused
- True if the component is to be focused.public void setActionCommand(java.lang.String command)
setActionCommand
in interface EventSource
setActionCommand
in class CustomComponent
public void actionPerformed(ActionEvent e)
ActionListener
actionPerformed
in interface ActionListener
e
- The event describing the action.public void setStateMargin(int i)
newValue
- The size of the margin between the state indicator and the
toggle button's text, in pixels.public int getStateMargin()
public void applyStyle(Style style)
Component
Style
object. The version of this method in Component
will set
foreground and background colors and the font from the style if they are
present. Components should override this method if they allow more
properties to be set from a style object, and should call
super.applyStyle() if necessary.
applyStyle
in interface Component
applyStyle
in class AbstractComponent
style
- The style object from which to retrieve properties for this
Component
.public void applyContext()
applyContext
in interface Precreation
public boolean isAsync()
public void setAsync(boolean async)
public void setFont(Font font)
Component
setFont
in interface Component
setFont
in class AbstractComponent
font
- The new font of the component.public Font getFont()
Component
getFont
in interface Component
getFont
in class AbstractComponent
public java.lang.String getCssClass()
public void setCssClass(java.lang.String cssClass)
public java.lang.String getCssClassDisabled()
public void setCssClassDisabled(java.lang.String cssClass)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |