OverviewSingleDeprecated

jsx3.gui

class ToolbarButton

Object
->jsx3.lang.Object
  ->jsx3.app.Model
    ->jsx3.gui.Painted
      ->jsx3.gui.Block
        ->jsx3.gui.ToolbarButton

All Implemented Interfaces:

jsx3.gui.Form, jsx3.gui.Interactive, jsx3.util.EventDispatcher

class ToolbarButton
extends jsx3.gui.Block
Renders a toolbar button. Normal, check, and radio type buttons are supported. All buttons support 16x16 pixel icons. When rendered, buttons are 22 pixels wide by 22 pixels high (unless a text label is used or a menu is bound, in which case the button is wider).

This class publishes the following model events:

Field Summary
static int
STATEOFF
Value of the state field indicating the up/off state.
static int
STATEON
Value of the state field indicating the down/on state.
static int
TYPECHECK
Value of the type field indicating a check button.
static int
TYPENORMAL
Value of the type field indicating a normal (stateless) button.
static int
TYPERADIO
Value of the type field indicating a radio button.
Constructor Summary
void
init(strName : String, intType : int, strTip : String)
The instance initializer.
Method Summary
void
Deprecated. Use doExecute() to invoke the EXECUTE model event programmatically.
void
Invokes the EXECUTE model event of this toolbar button.
int
Validates this button based on the type of button and whether this control is required.
String
Returns the URL of the image to use when this button is disabled.
int
Returns whether this toolbar button renders a visual divider on its left side.
String
Returns the name of the group to which this radio button belongs.
String
Returns the URL of the image to use to render this button.
int
Returns the state of this button.
int
Returns the type of this button.
static String
Deprecated.
String
Returns this toolbar button serialized to HTML.
jsx3.gui.ToolbarButton
Sets the URL of the image to use when this button is disabled.
jsx3.gui.ToolbarButton
setDivider(intDivider : int, bRecalc : ?)
Sets whether this toolbar button renders a visual divider on its left side.
jsx3.gui.ToolbarButton
setGroupName(strGroupName : String)
Sets the name of the group to which this radio button belongs.
jsx3.gui.ToolbarButton
setImage(strURL : String)
Sets the URL of the image to use to render this button.
jsx3.gui.ToolbarButton
setState(intState : int)
Sets the state of this button.
jsx3.gui.ToolbarButton
setType(TYPE : int)
Sets the type of this button.
Methods Inherited From jsx3.gui.Form
doKeyBinding, doReset, getDisabledBackgroundColor, getDisabledColor, getEnabled, getKeyBinding, getRequired, getValidationState, getValue, setDisabledBackgroundColor, setDisabledColor, setEnabled, setKeyBinding, setRequired, setValidationState, setValue
Methods Inherited From jsx3.gui.Block
getBackground, getBackgroundColor, getBorder, getCSSOverride, getClassName, getColor, getCursor, getDimensions, getDisplay, getFontName, getFontSize, getFontWeight, getHeight, getIndex, getLeft, getMargin, getOverflow, getPadding, getRelativePosition, getTagName, getText, getTextAlign, getTip, getTop, getVisibility, getWidth, getZIndex, hideMask, setBackground, setBackgroundColor, setBorder, setCSSOverride, setClassName, setColor, setCursor, setDimensions, setDisplay, setFontName, setFontSize, setFontWeight, setHeight, setIndex, setLeft, setMargin, setOverflow, setPadding, setRelativePosition, setTagName, setText, setTextAlign, setTip, setTop, setVisibility, setWidth, setZIndex, showMask
Methods Inherited From jsx3.gui.Interactive
doEvent, getCanDrag, getCanDrop, getCanMove, getCanSpy, getEvent, getEvents, getMenu, hasEvent, registerHotKey, removeEvent, removeEvents, setCanDrag, setCanDrop, setCanMove, setCanSpy, setEvent, setMenu, setSpyStyles, showSpy
Methods Inherited From jsx3.gui.Painted
focus, getAbsolutePosition, getAttribute, getAttributes, getDynamicProperty, getRendered, insertHTML, onAfterPaint, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute, setDynamicProperty
Methods Inherited From jsx3.app.Model
adoptChild, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, setChild, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

STATEOFF

static final int STATEOFF
Value of the state field indicating the up/off state. A normal button is always off.

STATEON

static final int STATEON
Value of the state field indicating the down/on state. Check and radio buttons may be on.

TYPECHECK

static final int TYPECHECK
Value of the type field indicating a check button. A check button is a two-state button with a down state (on) and an up state (off).

TYPENORMAL

static final int TYPENORMAL
Value of the type field indicating a normal (stateless) button.

TYPERADIO

static final int TYPERADIO
Value of the type field indicating a radio button. A radio button is a two-state button that exists as a member of a set of radio buttons. Only one radio button is a set may be in a down state at one time.
Constructor Detail

init

void init(strName : String, intType : int, strTip : String)
The instance initializer.

Parameters:

strNameunique name distinguishing this object from all other JSX GUI objects in the JSX application
intTypethe type of button to create: TYPENORMAL, or TYPECHECK, TYPERADIO.
strTipthe tooltip text for the button.
Method Detail

doClick

void doClick()
Deprecated. Use doExecute() to invoke the EXECUTE model event programmatically.
Invokes the EXECUTE model event of this toolbar button.

See Also:

doExecute()

doExecute

void doExecute(objEvent : jsx3.gui.Event)
Invokes the EXECUTE model event of this toolbar button. Note that because the model event is invoked programmatically rather than by user interaction the objEVENT event parameter will be null if the objEvent parameter is undefined. If this is a radio button its state is set to on. If this is a check button, its state is toggled.

Parameters:

objEventthe browser event that caused the execution of this button. This argument is optional and should only be provided if the execution of this button is the result of a browser event. This parameter will be passed along to the model event as objEVENT.

doValidate

int doValidate()
Validates this button based on the type of button and whether this control is required. Normal buttons are always valid because they have no state. Radio and check buttons are valid if they are on or if they are not required.

Returns:

jsx3.gui.Form.STATEVALID or jsx3.gui.Form.STATEINVALID

Overrides:

doValidate in jsx3.gui.Form

See Also:

jsx3.gui.Form.STATEVALID, jsx3.gui.Form.STATEINVALID

getDisabledImage

String getDisabledImage()
Returns the URL of the image to use when this button is disabled.

Returns:

 

getDivider

int getDivider()
Returns whether this toolbar button renders a visual divider on its left side.

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE.  

getGroupName

String getGroupName()
Returns the name of the group to which this radio button belongs. This method returns null if this button is not a radio button.

Returns:

 

See Also:

TYPERADIO

getImage

String getImage()
Returns the URL of the image to use to render this button.

Returns:

 

getState

int getState()
Returns the state of this button. A normal button always returns STATEOFF. Radio and check buttons may return STATEOFF or STATEON.

Returns:

STATEON or STATEOFF

See Also:

STATEON, STATEOFF

getType

int getType()
Returns the type of this button.

Returns:

TYPENORMAL, or TYPECHECK, or TYPERADIO.  

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

paint

String paint()
Returns this toolbar button serialized to HTML.

Returns:

 

Overrides:

paint in jsx3.gui.Block

setDisabledImage

jsx3.gui.ToolbarButton setDisabledImage(strURL : String)
Sets the URL of the image to use when this button is disabled. If no disabled image is set the normal image is used instead.

Parameters:

strURLthe URL of an image file, 16px by 16px.

Returns:

this object.  

setDivider

jsx3.gui.ToolbarButton setDivider(intDivider : int, bRecalc : ?)
Sets whether this toolbar button renders a visual divider on its left side. The divider is useful for visually separating this toolbar button from the next toolbar button to the left.

Parameters:

intDividerjsx3.Boolean.TRUE or jsx3.Boolean.FALSE.
bRecalc

Returns:

this object.  

setGroupName

jsx3.gui.ToolbarButton setGroupName(strGroupName : String)
Sets the name of the group to which this radio button belongs. This method only applies to radio buttons.

Parameters:

strGroupNamethe name of button group.

Returns:

this object. 

See Also:

TYPERADIO

setImage

jsx3.gui.ToolbarButton setImage(strURL : String)
Sets the URL of the image to use to render this button. The URL is resolved by the URI resolver of this button before it is rendered to HTML.

Parameters:

strURLthe URL of an image file, 16px by 16px.

Returns:

this object.  

setState

jsx3.gui.ToolbarButton setState(intState : int)
Sets the state of this button. This method effects both the model and the view immediately. This method invokes the CHANGE model event only under the deprecated 3.0 model event protocol.

Parameters:

intStateSTATEON or STATEOFF.

Returns:

this object. 

See Also:

STATEON, STATEOFF

setType

jsx3.gui.ToolbarButton setType(TYPE : int)
Sets the type of this button.

Parameters:

TYPETYPENORMAL, or TYPECHECK, TYPERADIO.

Returns:

this object. 

See Also:

TYPENORMAL, TYPECHECK, TYPERADIO