com.primix.tapestry.html
Class Rollover
java.lang.Object
|
+--com.primix.tapestry.AbstractComponent
|
+--com.primix.tapestry.html.Rollover
- All Implemented Interfaces:
- IComponent, IRender
- public class Rollover
- extends AbstractComponent
Combines an Action
with an <img> and JavaScript code
to create a rollover effect that works with both Netscape Navigator and
Internet Explorer.
A Rollover
must be contained within a Body
and within
an IActionListener
. The JavaScript handlers for dealing with mouse
movement are applied to the <a> created by the IActionListener
. For compatibility
with Netscape 4, the handlers are attached using HTML attributes (it would cleaner
and easier to do so using the DOM).
Parameter |
Type |
Read / Write |
Required |
Default |
Description |
image |
IAsset |
R |
yes |
|
The (initial) image to show. |
focus |
IAsset |
R |
no |
|
If provided (and the component is not disabled), then a JavaScript onMouseOver event handler
is added to change the image. An onMouseOut event handler is also
provided, to change the button to either it's base image, or its blur image. |
blur |
IAsset |
R |
no |
|
If provided (and the component is not disabled), then a JavaScript onMouseOut event handler
is added to change the image when the mouse is moved off of the image. |
disabled |
IAsset |
R |
no |
|
Image used when the Rollover is disabled. A Rollover
is disabled when the IServiceLink containing it is disabled. If no disabled
asset is specified, then image asset is used instead.
A disabled Rollover does not respond to the mouse.
|
Informal parameters are allowed and are applied to the <img> tag. A body
is not allowed.
- Version:
- $Id: Rollover.java,v 1.14 2001/09/04 01:27:47 hship Exp $
- Author:
- Howard Ship
Methods inherited from class com.primix.tapestry.AbstractComponent |
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Rollover
public Rollover()
getAssetURL
protected java.lang.String getAssetURL(java.lang.String name,
IBinding binding,
IRequestCycle cycle)
throws RequestCycleException
- Converts an
IAsset
binding into a usable URL. Returns null
if the binding does not exist or the binding's value is null.
getBlurBinding
public IBinding getBlurBinding()
getDisabledBinding
public IBinding getDisabledBinding()
getFocusBinding
public IBinding getFocusBinding()
getImageBinding
public IBinding getImageBinding()
render
public void render(IResponseWriter writer,
IRequestCycle cycle)
throws RequestCycleException
- Description copied from interface:
IRender
- The principal rendering/rewinding method. This will cause
the receiving component to render its top level elements (HTML
text and components).
Renderring and rewinding are the exact same process. The
same code that renders must be able to restore state by going
through the exact same operations (even though the output is
discarded).
setBlurBinding
public void setBlurBinding(IBinding newBlur)
setDisabledBinding
public void setDisabledBinding(IBinding newDisabled)
setFocusBinding
public void setFocusBinding(IBinding newFocus)
setImageBinding
public void setImageBinding(IBinding value)