public interface StatefulImages
stateful componentsmay display different media depending on the current state of the component. See the
Button.iconattribute for examples of such "stateful images".
In general the media to load for each state may be specified in two ways:
image URL, this value will be treated as a default, or base URL. When a new
stateis applied, this filename will be combined with the state name to form a combined URL. This in turn changes the media that gets loaded and updates the image to reflect the new state.
sprite configuration documentationfor a discussion of how sprites can be used for stateful images.
The following table lists out the standard set
of combined URLs that may be generated. Subclasses may support additional state-derived media
of course. Note that the src URL will be split such that the extension is always applied to the
end of the combined string. For example in the following table, if
src was set to
"blank.gif", the Selected+Focused URL would be
|URL for Img source||Description|
| ||Applied when |
||Applied when the component has keyboard focus, if |
| ||Applied when the user
rolls over the component if |
||Applied when the user presses the mouse button over over the component if |
||Applied to |
||Combined Selected and focused state|
| ||Combined Selected and rollOver state|
| ||Combined Focused and rollOver state|
||Combined Selected, Focused and rollOver state|
| ||Combined Selected and mouse-down state|
| ||Combined Focused and mouse-down state|
||Combined Selected, Focused and mouse-down state|
| ||Combined Selected and Disabled state|
SCStatefulImgConfigobject allows developers to specify a set of explicit image URLs, one for each state to be displayed, rather than relying on an automatically generated combined URL. This pattern is useful for cases where the filename of the stateful versions of the image doesn't match up with the auto-generated format.