ilog.views.faces.dhtml.interactor
Class IlvFacesSelectInteractor

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by ilog.views.faces.component.IlvFacesComponentBase
              extended by ilog.views.faces.interactor.IlvInteractor
                  extended by ilog.views.faces.dhtml.interactor.IlvFacesSelectInteractor
All Implemented Interfaces:
IlvFacesComponent, IlvDHTMLConstants, IlvFacesConstants, IlvFacesInteractor, Serializable, StateHolder
Direct Known Subclasses:
IlvFacesDiagrammerSelectInteractor

public class IlvFacesSelectInteractor
extends IlvInteractor
implements IlvDHTMLConstants

This is the base class for interactors that allow selecting one or several objects on a view, and moving the current selection. The way the selection is actually managed can be configured using an IlvFacesSelectionManager.

To perform client-side actions on selection, add a JavaScript handler through the setOnSelectionChanged(String) method.

A predefined selection variable will be provided to the JavaScript code in this handler. The selection is an array of objects.

Each of these selection objects has implements the IlvSelectionRectangle JavaScript prototype.

Since:
JViews 7.5
See Also:
Serialized Form

Field Summary
static Boolean FORCE_UPDATE_DEFAULT_VALUE
          Default value of forceUpdateProperties property
static Boolean IMAGE_MODE_DEFAULT_VALUE
          Default value of imageMode property
 String internalState
           
static Integer LINE_WIDTH_DEFAULT_VALUE
          Default value of lineWidth property
static Boolean MOVE_ALLOWED_DEFAULT_VALUE
          Default value of moveAllowed property
 
Fields inherited from interface ilog.views.faces.dhtml.IlvDHTMLConstants
AUTO_SUBMIT, BACKGROUND_COLOR, CAPABILITIES_LOADED_HANDLER, COMPONENT, DO_ACTION_ON_BG_DESELECT, ERROR_MESSAGE, GENERATE_IMAGE_MAP, IMAGE_FORMAT, IMAGE_LOADED_HANDLER, IMAGE_MAP_GENERATOR, IMAGE_MAP_GENERATOR_CLASS, IMAGE_MAP_VISIBLE, IMAGE_SERVLET_CONTEXT, INVOCATION_CONTEXT, JSF_CONTEXT, ON_CLICK, ON_SELECTION_CHANGED, PORTLET_CONTEXT_KEY, PORTLET_SESSION_KEY, REPLACE_PATTERN, RESIZABLE, SESSION_EXP_HANDLER, SUBMITTED_VALUE, WAITING_IMAGE
 
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
IlvFacesSelectInteractor()
          Creates a new IlvFacesSelectInteractor instance.
 
Method Summary
static String getComponentType()
          Returns the type of this component.
 String getFamily()
          Returns the identifier of the component family to which this component belongs.
 Color getLineColor()
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.getLineColor() instead.
 int getLineWidth()
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.getLineWidth() instead.
 String getOnSelectionChanged()
          Returns a JavaScript handler called when the selection has changed.
 boolean isForceUpdateProperties()
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.isForceUpdateProperties() instead.
 boolean isImageMode()
          Returns the image mode.
 boolean isMoveAllowed()
          Returns whether allow or forbid to move selection.
 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 setForceUpdateProperties(boolean forceUpdateProperties)
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setForceUpdateProperties(boolean) instead.
 void setImageMode(boolean imageMode)
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setImageMode(boolean) instead.
 void setLineColor(Color color)
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setLineColor(Color) instead.
 void setLineWidth(int lineWidth)
          Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setLineWidth(int) instead.
 void setMoveAllowed(boolean moveAllowed)
          Sets whether allow or forbid to move selection.
 void setOnSelectionChanged(String onSelectionChanged)
          Sets a JavaScript handler called when the selection has changed.
 void updateModel(FacesContext context)
          Handles the "Update Model Values" phase of the JSF life cycle. This method updates the referenced values with the local values of the component if theses values were updated during the "Apply Request Values" phase.
 
Methods inherited from class ilog.views.faces.interactor.IlvInteractor
getCursor, getMenuModelId, getMessage, setCursor, setMenuModelId, setMessage
 
Methods inherited from class ilog.views.faces.component.IlvFacesComponentBase
clearDecodedPropertyMap, createFacesComponent, getAttributes, getClientId, isDecodedProperty, processUpdates, resetDecodedProperties, setDecodedProperty
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processValidators, queueEvent, 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

LINE_WIDTH_DEFAULT_VALUE

public static final Integer LINE_WIDTH_DEFAULT_VALUE
Default value of lineWidth property


MOVE_ALLOWED_DEFAULT_VALUE

public static final Boolean MOVE_ALLOWED_DEFAULT_VALUE
Default value of moveAllowed property


IMAGE_MODE_DEFAULT_VALUE

public static final Boolean IMAGE_MODE_DEFAULT_VALUE
Default value of imageMode property


FORCE_UPDATE_DEFAULT_VALUE

public static final Boolean FORCE_UPDATE_DEFAULT_VALUE
Default value of forceUpdateProperties property


internalState

public String internalState
Internal method or field: do not use!
Constructor Detail

IlvFacesSelectInteractor

public IlvFacesSelectInteractor()
Creates a new IlvFacesSelectInteractor instance.

Method Detail

getFamily

public String getFamily()
Returns the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate renderer for this component instance.

Overrides:
getFamily in class IlvInteractor
Returns:
The family to which this component belongs.

getComponentType

public static String getComponentType()
Returns the type of this component.

Returns:
The type of this component.

getLineColor

public Color getLineColor()
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.getLineColor() instead.

Returns the color of selection rectangles, if this interactor is not in image mode.

Returns:
The color.

setLineColor

public void setLineColor(Color color)
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setLineColor(Color) instead.

Sets the color of selection rectangles, if this interactor is not in image mode.

Parameters:
color - The color to set.

getLineWidth

public int getLineWidth()
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.getLineWidth() instead.

Returns the width of selection rectangle lines, if this interactor is not in image mode.

Returns:
The lineWidth.

setLineWidth

public void setLineWidth(int lineWidth)
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setLineWidth(int) instead.

Sets the width of selection rectangle lines, if this interactor is not in image mode.

Parameters:
lineWidth - The lineWidth to set.

isMoveAllowed

public boolean isMoveAllowed()
Returns whether allow or forbid to move selection. The server-side selected object must also be movable.

Returns:
true if the selection can be moved, false otherwise.

setMoveAllowed

public void setMoveAllowed(boolean moveAllowed)
Sets whether allow or forbid to move selection. The server-side selected object must also be movable.

Parameters:
moveAllowed - true if the selection can be moved, false otherwise.

isImageMode

public boolean isImageMode()
Returns the image mode.

In image mode the image is refreshed on each selection.

In regular mode, only the selected object(s) bounding box is queried and rectangle are dynamically displayed on top of the view.

Note that the client-side listeners on selection and additionalinformation on selected objects are available in image mode if and only if the forceUpdateProperties property is set to true. In regular mode no special configuration is needed.

Returns:
true is the image mode is set, false otherwise.
Since:
since JViews 8.0 use IlvFacesSelectionManager.isImageMode() instead.

setImageMode

public void setImageMode(boolean imageMode)
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setImageMode(boolean) instead.

Sets the image mode.

In image mode the image is refreshed on each selection.

In regular mode, only the selected object(s) bounding box is queried and rectangle are dynamically displayed on top of the view.

Note that the client-side listeners on selection and additionalinformation on selected objects are available in image mode if and only if the forceUpdateProperties property is set to true. In regular mode no special configuration is needed.

Parameters:
imageMode - true is the image mode is set, false otherwise.

isForceUpdateProperties

public boolean isForceUpdateProperties()
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.isForceUpdateProperties() instead.

Returns true to force an additional request in image mode, false otherwise.

Returns:
trueto force the query of the current selection, falseotherwise.

setForceUpdateProperties

public void setForceUpdateProperties(boolean forceUpdateProperties)
Deprecated. Beginning with JViews 8.0 use IlvFacesSelectionManager.setForceUpdateProperties(boolean) instead.

Sets this flag to make additional request to query the current selection and additional properties in image mode to enable client-side selection listener.

Parameters:
forceUpdateProperties - true to force a additional request in image mode, false otherwise.

getOnSelectionChanged

public String getOnSelectionChanged()
Returns a JavaScript handler called when the selection has changed.

The handler must be a function with one parameter which is the selection list.

To use this handler the interactor must be in regular mode or the forceUpdateProperties must be set if the interactor is in image mode. See the user manual for further information.

Returns:
The JavaScript handler on a new selection.

setOnSelectionChanged

public void setOnSelectionChanged(String onSelectionChanged)
Sets a JavaScript handler called when the selection has changed.

The handler must be a function with one parameter which is the selection list.

To use this handler the interactor must be in regular mode or the forceUpdateProperties must be set if the interactor is in image mode. See the user manual for further information.

Parameters:
onSelectionChanged - The JavaScript handler on a new selection.

updateModel

public void updateModel(FacesContext context)
Handles the "Update Model Values" phase of the JSF life cycle. This method updates the referenced values with the local values of the component if theses values were updated during the "Apply Request Values" phase.

Overrides:
updateModel in class IlvInteractor
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 IlvInteractor
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 IlvInteractor
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.