ilog.views.faces.component
Class IlvImageButton

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by ilog.views.faces.component.IlvImageButton
All Implemented Interfaces:
IlvFacesComponent, IlvFacesConstants, Serializable, ActionSource, StateHolder
Direct Known Subclasses:
IlvDHTMLImageButton

public class IlvImageButton
extends UICommand
implements IlvFacesComponent

This class defines a DHTML button that is represented by images depending on its state (normal, highlighted, selected).
This button can be a toggle button (and so have two selection states: selected and not selected) and be a part of a button group in which one button can be selected at a time.

Since:
JViews 6.0
See Also:
Serialized Form

Field Summary
static Boolean ENABLED_DEFAULT_VALUE
          Default value of enabled property.
static Boolean SELECTED_DEFAULT_VALUE
          Default value of selected property.
static Boolean TOGGLE_DEFAULT_VALUE
          Default value of toggle property.
 
Fields inherited from class javax.faces.component.UICommand
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface ilog.views.faces.IlvFacesConstants
BUTTON_GROUP_ID, BUTTON_TYPE, CHARTS_BUNDLE, CORE_BUNDLE, CURSOR, DATA, DECODED_PROPERTY, DEFAULT_LINE_COLOR, DELETION_ALLOWED, DIAGRAMMER_BUNDLE, ENABLED, FILL_ON, FORCE_UPDATE_PROPERTIES, FRAMEWORK_BUNDLE, GANTT_BUNDLE, HEIGHT, IMAGE, IMAGE_MODE, INFO_PROVIDER_MB, INT_NOT_DEFINED, ITEM_DISABLED_STYLE_CLASS, ITEM_HIGHLIGHTED_STYLE_CLASS, ITEM_STYLE_CLASS, LINE_COLOR, LINE_WIDTH, MAPS_BUNDLE, MENU_MODEL_ID, MESSAGE, MESSAGE_BOX, MESSAGE_BOX_ID, MOVE_ALLOWED, OBJECT_FINDER, PARAM_COMPID, PARAM_DATA, PARAM_KEY, PARAM_NAMESPACE, PARAM_RESOURCE, PARAM_SERVICE, PARAM_TYPE, POPUP_MENU, POPUP_MENU_FACTORY, POPUP_MENU_FACTORY_CLASS, PORTLET_NAMESPACE, PROJECT, RESOURCES_PATH, RESOURCES_PATH_PREFIX, ROLLOVER_IMAGE, SELECTED, SELECTED_IMAGE, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVLET, SERVLET_CLASS, SERVLET_URL, STYLE, STYLE_CLASS, TGO_BUNDLE, TITLE, TOGGLE, VALUE, VIEW, VIEW_ID, WIDTH
 
Constructor Summary
IlvImageButton()
          Creates a new IlvImageButton instance.
 
Method Summary
 void clearDecodedPropertyMap()
          Clears the decoded properties.
 IlvFacesComponent createFacesComponent()
          Creates the component that handles the implementation of the IlvFacesComponent interface.
 Map getAttributes()
          Return a mutable Map representing the attributes (and properties, see below) associated with this UIComponent, keyed by attribute name (which must be a String).
 String getButtonGroupId()
          Returns the identifier of the button group.
 String getCursor()
          Returns the cursor displayed when the mouse is on the button.
 String getImage()
          Returns the URL of the image representing the button.
 String getMessage()
          Returns the message that can be displayed when the cursor is on the button.
 IlvButtonGroup getOrCreateButtonGroup(String buttonGroupId)
          Finds a button group from its identifier as a child of the view root.
 String getRolloverImage()
          Returns the URL of the image representing the button when the cursor is over the button.
 String getSelectedImage()
          Returns the URL of the image representing the button when this button is selected.
 Object getValue()
          Returns the selection state of this button.
 boolean isDecodedProperty(String property)
          Returns true if the specified property was decoded during the "Apply Request Value" phase of the JSF lifecycle, false otherwise.
 boolean isEnabled()
          Returns the enabled state of this button.
 boolean isSelected()
          Returns the selection state of this button.
 boolean isToggle()
          Returns the toggle state of this button.
 void processUpdates(FacesContext context)
          Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.
 void resetDecodedProperties()
          Resets the decoded properties of this component.
 void restoreState(FacesContext context, Object stateObj)
          Restores the state of this component from the state parameter.
 Object saveState(FacesContext context)
          Returns the state of this component.
 void setButtonGroupId(String buttonGroupId)
          Sets the identifier of the button group linked to this button.
 void setCursor(String cursor)
          Sets the cursor displayed when the mouse is on the button.
 void setDecodedProperty(String property)
          Sets the property to decoded, which means that the property value was updated from the request during the "Apply Request Value" phase of the JSF life cycle.
 void setEnabled(boolean enabled)
          Determines whether this button is a enable or not.
 void setImage(String image)
          Sets the URL of the image representing the button.
 void setMessage(String message)
          Sets the message that can be displayed when the cursor is on the button.
 void setRolloverImage(String rolloverImage)
          Sets the URL of the image representing the button when the cursor is over the button.
 void setSelected(boolean selected)
          Sets the selection state.
 void setSelectedImage(String selectedImage)
          Sets the URL of the image representing the button when this button is selected.
 void setToggle(boolean toggle)
          Determines whether this button is a toggle button.
 void setValue(Object value)
          Sets the selection state of this button if it is a toggle button.
protected  void updateModel(FacesContext context)
          This method updates the referenced values with the local values of the component if these values were updated from the client.
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, broadcast, getAction, getActionListener, getActionListeners, getFamily, isImmediate, queueEvent, removeActionListener, setAction, setActionListener, setImmediate
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED_DEFAULT_VALUE

public static final Boolean ENABLED_DEFAULT_VALUE
Default value of enabled property.

Since:
JViews 8.0

TOGGLE_DEFAULT_VALUE

public static final Boolean TOGGLE_DEFAULT_VALUE
Default value of toggle property.

Since:
JViews 6.5

SELECTED_DEFAULT_VALUE

public static final Boolean SELECTED_DEFAULT_VALUE
Default value of selected property.

Since:
JViews 6.5
Constructor Detail

IlvImageButton

public IlvImageButton()
Creates a new IlvImageButton instance.

Method Detail

createFacesComponent

public IlvFacesComponent createFacesComponent()
Creates the component that handles the implementation of the IlvFacesComponent interface. By default, it returns an IlvFacesComponentImpl instance.

Returns:
The component that handles the implementation of the IlvFacesComponent interface.

getAttributes

public Map getAttributes()

Return a mutable Map representing the attributes (and properties, see below) associated with this UIComponent, keyed by attribute name (which must be a String). The returned implementation must support all of the standard and optional Map methods, plus support the following additional requirements:

Overrides:
getAttributes in class UIComponentBase
Since:
JViews 8.1

clearDecodedPropertyMap

public void clearDecodedPropertyMap()
Clears the decoded properties.

Specified by:
clearDecodedPropertyMap in interface IlvFacesComponent

isDecodedProperty

public boolean isDecodedProperty(String property)
Returns true if the specified property was decoded during the "Apply Request Value" phase of the JSF lifecycle, false otherwise.

Specified by:
isDecodedProperty in interface IlvFacesComponent
Parameters:
property - The property to test.
Returns:
true if the property was decoded, false otherwise.

resetDecodedProperties

public void resetDecodedProperties()
Resets the decoded properties of this component.

Specified by:
resetDecodedProperties in interface IlvFacesComponent

setDecodedProperty

public void setDecodedProperty(String property)
Sets the property to decoded, which means that the property value was updated from the request during the "Apply Request Value" phase of the JSF life cycle. This method must be called by renderers only during the execution of their decode method.

Specified by:
setDecodedProperty in interface IlvFacesComponent
Parameters:
property - The property to set to decoded.

setValue

public void setValue(Object value)
Sets the selection state of this button if it is a toggle button.

Overrides:
setValue in class UICommand
Parameters:
value - The selection state to be set for this button.

getValue

public Object getValue()
Returns the selection state of this button. The state is relevant if the button is a toggle button.

Overrides:
getValue in class UICommand
Returns:
The selection state of this button.

setSelected

public void setSelected(boolean selected)
Sets the selection state.
This method is an alias for setValue(Object value).

Parameters:
selected - The selection state of this button.

isSelected

public boolean isSelected()
Returns the selection state of this button.
This method is an alias for getValue().

Returns:
The selection state of this button.

getButtonGroupId

public String getButtonGroupId()
Returns the identifier of the button group.

Returns:
The identifier of the button group.

setButtonGroupId

public void setButtonGroupId(String buttonGroupId)
Sets the identifier of the button group linked to this button. In a button group, one toggle button can be selected at a time.

Parameters:
buttonGroupId - The identifier of the button group.

getOrCreateButtonGroup

public IlvButtonGroup getOrCreateButtonGroup(String buttonGroupId)
Finds a button group from its identifier as a child of the view root. If the button group is not found, a new one is created with the specified identifier and stored as a child of the view root.

Parameters:
buttonGroupId -
Returns:
A button group.

isToggle

public boolean isToggle()
Returns the toggle state of this button. If the button is a toggle button, it has two selection states (selected and not selected).

Returns:
true if this button is a toggle button, false otherwise.

setToggle

public void setToggle(boolean toggle)
Determines whether this button is a toggle button.

Parameters:
toggle - The toggle state to be set for this button.

isEnabled

public boolean isEnabled()
Returns the enabled state of this button.

Returns:
true if this button is enabled, false otherwise.
Since:
JViews 8.0

setEnabled

public void setEnabled(boolean enabled)
Determines whether this button is a enable or not.

Parameters:
enabled - The enabled state to be set for this button.
Since:
JViews 8.0

getRolloverImage

public String getRolloverImage()
Returns the URL of the image representing the button when the cursor is over the button.

Returns:
The URL of the rollover image of this button.

setRolloverImage

public void setRolloverImage(String rolloverImage)
Sets the URL of the image representing the button when the cursor is over the button.

Parameters:
rolloverImage - The URL of the rollover image to be set for this button.

getImage

public String getImage()
Returns the URL of the image representing the button.

Returns:
The URL of the image representing the button.

setImage

public void setImage(String image)
Sets the URL of the image representing the button.

Parameters:
image - The image URL to be set for this button.

getSelectedImage

public String getSelectedImage()
Returns the URL of the image representing the button when this button is selected.

Returns:
The URL of the selected image of this button.

setSelectedImage

public void setSelectedImage(String selectedImage)
Sets the URL of the image representing the button when this button is selected.

Parameters:
selectedImage - The URL of the image to be set.

getCursor

public String getCursor()
Returns the cursor displayed when the mouse is on the button.

Returns:
Returns the cursor displayed when the mouse is on the button.

setCursor

public void setCursor(String cursor)
Sets the cursor displayed when the mouse is on the button.

Parameters:
cursor - The cursor to be set.

getMessage

public String getMessage()
Returns the message that can be displayed when the cursor is on the button.

Returns:
The message that can be displayed when the cursor is on the button.

setMessage

public void setMessage(String message)
Sets the message that can be displayed when the cursor is on the button.

Parameters:
message - The message that can be displayed when the cursor is on the button.

processUpdates

public void processUpdates(FacesContext context)

Perform the component tree processing required by the Update Model Values phase of the request processing lifecycle for all facets of this component, all children of this component, and this component itself, as follows.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - The current faces context.
Throws:
NullPointerException - if context is null

updateModel

protected void updateModel(FacesContext context)
This method updates the referenced values with the local values of the component if these values were updated from the client.

Parameters:
context - The current faces context.

saveState

public Object saveState(FacesContext context)
Returns the state of this component.

Specified by:
saveState in interface IlvFacesComponent
Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UICommand
Parameters:
context - The current faces context.
Returns:
The state of this component.

restoreState

public void restoreState(FacesContext context,
                         Object stateObj)
Restores the state of this component from the state parameter.

Specified by:
restoreState in interface IlvFacesComponent
Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UICommand
Parameters:
context - The current faces context.
stateObj - The previously saved state of this component.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.