# com.bea.netuix.servlets.controls.window
ToggleButtonPresentationContext Class

public class ToggleButtonPresentationContext
extends `AbstractButtonPresentationContext`

An implementation of AbstractButtonPresentationContext. Toggle buttons differ from standard buttons in that they have two "modes": activate and deactivate. For example, an `Edit` button has an "enter edit" (activate) mode and a "leave edit" (deactivate) mode.

Like its parent, this class is typically used during portal rendering via look and feel skeleton files (e.g. togglebutton.jsp).

Related Topics

``ToggleButtonPresentationContext.getToggleButtonPresentationContext(HttpServletRequest)``

Hierarchy
  `Object`
  `ControlContext`
  `PresentationContext`
  `AbstractButtonPresentationContext`
  `ToggleButtonPresentationContext`

All Implemented Interfaces
  `Serializable`

## Field Summary

Fields from com.bea.netuix.servlets.controls.window`.`AbstractButtonPresentationContext``
``CLASS_NAME``

Fields from com.bea.netuix.servlets.controls`.`ControlContext``
`debug`

## Constructor Summary

## Method Summary

`public `String`` | `getActivateAltText`() The activateAltText attribute represents the alt text to be rendered when this `Button` is in its "activate" state.
`public `String`` | `getActivateImage`() The activateImage attribute represents the name of the standard image that this `Button` should use when representing its "activate" state.
`public `String`` | `getActivateRolloverImage`() The activateRolloverImage attribute represents the name of the image to be rendered upon rollover of this `Button` while in its "activate" state.
`public `String`` | `getAltText`() This method will return the appropriate alt text (activateAltText or deactivateAltText) for the current state of the `Button`.
`public `String`` | `getDeactivateAltText`() The deactivateAltText attribute represents the alt text to be rendered when this `Button` is in its "deactivate" state.
`public `String`` | `getDeactivateImage`() The deactivateImage attribute represents the name of the standard image that this `Button` should use when representing its "deactivate" state.
`public `String`` | `getDectivateRolloverImage`() The deactivateRolloverImage attribute represents the name of the image to be rendered upon rollover of this `Button` while in its "deactivate" state.
`public `String`` | `getImage`() This method will return the appropriate image name (activateImage or deactivateImage) for the current state of the `Button`.
`public `String`` | `getImageSrc`() This method will return the appropriate image content URI (activateImage or deactivateImage) for the current state of the `Button`.
`public `String`` | `getRolloverImage`() This method will return the appropriate rolloverImage name (activateRolloverImage or deactivateRolloverImage) for the current state of the `Button`.
`public `String`` | `getRolloverImageSrc`() This method will return the appropriate rolloverImage content URI (activateRolloverImage or deactivateRolloverImage) for the current state of the `Button`.
`public static `ToggleButtonPresentationContext`` | `getToggleButtonPresentationContext`(`HttpServletRequest` request) This is a convenience method for returning a reference to the one and only `ToggleButtonPresentationContext` for a given `ToggleButton`.
`public boolean` | `isActive`() This method can be used to determine the current state of the `Button`.

Methods from `com.bea.netuix.servlets.controls.window.`AbstractButtonPresentationContext``
``getAbstractButtonPresentationContext`, `getContextKey`, `getEvent`, `getEventParam`, `getName`, `getWindowLabel`, `isParentPortlet``

Methods from `com.bea.netuix.servlets.controls.`PresentationContext``
``getChildren`, `getChildren`, `getFirstChild`, `getParsedProperties`, `getPresentationClass`, `getPresentationId`, `getPresentationStyle`, `getProperties`, `getProperty`, `getProperty`, `getPropertyAsBoolean`, `getPropertyAsInt`, `getResolvedLocale`, `getTagName`, `isVisible`, `setVisible``

Methods from `com.bea.netuix.servlets.controls.`ControlContext``
`getContextFromRequest, getContextKey, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Detail

## Method Detail

### getActivateAltText() Method

    public String getActivateAltText()

The activateAltText attribute represents the alt text to be rendered when this `Button` is in its "activate" state.

#### Returns

the value of the activateAltText attribute for this `Button` portal component, if any

### getActivateImage() Method

    public String getActivateImage()

The activateImage attribute represents the name of the standard image that this `Button` should use when representing its "activate" state.

#### Returns

the value of the activateImage attribute for this `Button` portal component, if any

### getActivateRolloverImage() Method

    public String getActivateRolloverImage()

The activateRolloverImage attribute represents the name of the image to be rendered upon rollover of this `Button` while in its "activate" state.

#### Returns

the value of the activateRolloverImage attribute for this `Button` portal component, if any

### getAltText() Method

    public String getAltText()

This method will return the appropriate alt text (activateAltText or deactivateAltText) for the current state of the `Button`. For example, if the `Button` is currently in an activate state, the deactivate alt text will be returned.

Overrides
  `AbstractButtonPresentationContext.getAltText()`

#### Returns

the appropriate alt text, based on the current `Button` state, if any

### getDeactivateAltText() Method

    public String getDeactivateAltText()

The deactivateAltText attribute represents the alt text to be rendered when this `Button` is in its "deactivate" state.

#### Returns

the value of the deactivateAltText attribute for this `Button` portal component, if any

### getDeactivateImage() Method

    public String getDeactivateImage()

The deactivateImage attribute represents the name of the standard image that this `Button` should use when representing its "deactivate" state.

#### Returns

the value of the deactivateImage attribute for this `Button` portal component, if any

### getDectivateRolloverImage() Method

    public String getDectivateRolloverImage()

The deactivateRolloverImage attribute represents the name of the image to be rendered upon rollover of this `Button` while in its "deactivate" state.

#### Returns

the value of the deactivateRolloverImage attribute for this `Button` portal component, if any

### getImage() Method

    public String getImage()

This method will return the appropriate image name (activateImage or deactivateImage) for the current state of the `Button`. For example, if the `Button` is currently in its activate state, the deactivate image name will be returned.

Overrides
  `AbstractButtonPresentationContext.getImage()`

#### Returns

the appropriate image name, based on the current `Button` state, if any

### getImageSrc() Method

    public String getImageSrc()

This method will return the appropriate image content URI (activateImage or deactivateImage) for the current state of the `Button`. For example, if the `Button` is currently in an activate state, the deactivate image URI will be returned.

Overrides
  `AbstractButtonPresentationContext.getImageSrc()`

#### Returns

the appropriate image content URI, based on the current `Button` state, if any

### getRolloverImage() Method

    public String getRolloverImage()

This method will return the appropriate rolloverImage name (activateRolloverImage or deactivateRolloverImage) for the current state of the `Button`. For example, if the `Button` is currently in an activate state, the deactivate rolloverImage name will be returned.

Overrides
  `AbstractButtonPresentationContext.getRolloverImage()`

#### Returns

the appropriate rolloverImage name, based on the current `Button` state, if any

### getRolloverImageSrc() Method

    public String getRolloverImageSrc()

This method will return the appropriate rolloverImage content URI (activateRolloverImage or deactivateRolloverImage) for the current state of the `Button`. For example, if the `Button` is currently in an activate state, the deactivate rolloverImage content URI will be returned.

Overrides
  `AbstractButtonPresentationContext.getRolloverImageSrc()`

#### Returns

the appropriate rolloverImage content URI, based on the current `Button` state, if any

### getToggleButtonPresentationContext(HttpServletRequest) Method

    public static ToggleButtonPresentationContext getToggleButtonPresentationContext(HttpServletRequest request)

This is a convenience method for returning a reference to the one and only `ToggleButtonPresentationContext` for a given `ToggleButton`. Note this method will only work if called from within a portal (e.g. togglebutton.jsp skeleton). This method may return null if called when no appropriate context exists, but such a context should safely exist when being fetched from the associated skeleton JSP during normal portal rendering.

#### Parameters

request
  The current HTTPServletRequest instance

#### Returns

A reference to the current ToggleButtonPresentationContext, if any

### isActive() Method

    public boolean isActive()

This method can be used to determine the current state of the `Button`. If the `Button` is currently in an activate state, true will be returned.

#### Returns

true if the `Button` is in an activate state