com.cc.framework.ui.control
Class RatingControl

java.lang.Object
  extended bycom.cc.framework.ui.control.Control
      extended bycom.cc.framework.ui.control.RatingControl
All Implemented Interfaces:
AccessControlled, ActionBehavior, ClientHandler, DataModel, RatingDataModel, RatingStateModel, java.io.Serializable, StateModel

public class RatingControl
extends Control
implements RatingStateModel, RatingDataModel

Rating control

Version:
$Revision: 1.4 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  RatingDataModel dataModel
          DataModel
private  RatingDesignModel designModel
          DesignModell
private static long serialVersionUID
          Serial Version UID
private  RatingStateModel stateModel
          StateModel
 
Fields inherited from class com.cc.framework.ui.control.Control
log
 
Fields inherited from interface com.cc.framework.ui.model.StateModel
PROP_CONTROL
 
Constructor Summary
RatingControl()
          Constructor
RatingControl(RatingDesignModel designModel)
          Constructor
 
Method Summary
protected  RatingStateModel doCreateStateModel()
          Creates the state model for this control instance
 DataModel getDataModel()
          Returns the data model of the Control
 ControlDesignModel getDesignModel()
          Returns the design model of the control
 java.lang.String getEmptyText()
          A text that is output in the body of the rating element if there are no elements available (size() == 0)
 boolean getFilter()
          Returns the Filter setting
 ImageMap getImageMap()
          Returns the associated ImageMap
 RatingItem getItem(int index)
          Retrieves the rating item with the given index
 StateModel getStateModel()
          Returns the state model of the control
 long getTotalValue()
          Retrieves the total value (=100%) for the control.
 void onItemClick(ControlRequestContext ctx, java.lang.String key)
          Default handler for the ItemCLick Event
 void reset()
          Resets the actual state of a control to the initial state
 void setDataModel(RatingDataModel dataModel)
          Sets the data model
 void setDesignModel(RatingDesignModel designModel)
          Sets the designModel
 void setStateModel(RatingStateModel stateModel)
          Sets the StateModel
 int size()
           
 
Methods inherited from class com.cc.framework.ui.control.Control
addButton, allowAjaxRendering, execute, execute, execute, execute, execute, execute, execute, getAction, getAjaxId, getButtons, getControlName, getDesignRules, getFrameworkString, getHandler, getHandlers, getHeight, getHelp, getId, getLocaleName, getName, getPermission, getPrincipal, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getUniqueStyleId, getWidth, isAjaxEnabled, isDisabled, isFormElement, markDirty, onHelp, setAjaxAttribute, setHandler, setPrincipal, setValue, show, showButton, synchronizeState, synchronizeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.model.StateModel
synchronizeState
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

dataModel

private RatingDataModel dataModel
DataModel


designModel

private RatingDesignModel designModel
DesignModell


stateModel

private RatingStateModel stateModel
StateModel

Constructor Detail

RatingControl

public RatingControl()
Constructor


RatingControl

public RatingControl(RatingDesignModel designModel)
Constructor

Parameters:
designModel - the design model
Method Detail

reset

public void reset()
Description copied from interface: StateModel
Resets the actual state of a control to the initial state

Specified by:
reset in interface StateModel
See Also:
StateModel.reset()

setStateModel

public void setStateModel(RatingStateModel stateModel)
Sets the StateModel

Parameters:
stateModel - TreeStateModel

doCreateStateModel

protected RatingStateModel doCreateStateModel()
Creates the state model for this control instance

Returns:
State model instance

getDataModel

public DataModel getDataModel()
Description copied from class: Control
Returns the data model of the Control

Specified by:
getDataModel in class Control
Returns:
The data model
See Also:
Control.getDataModel()

getDesignModel

public ControlDesignModel getDesignModel()
Description copied from class: Control
Returns the design model of the control

Specified by:
getDesignModel in class Control
Returns:
The ControlDesignModel
See Also:
Control.getDesignModel()

setDesignModel

public void setDesignModel(RatingDesignModel designModel)
Sets the designModel

Parameters:
designModel - The designModel to set

setDataModel

public void setDataModel(RatingDataModel dataModel)
Sets the data model

Parameters:
dataModel - TopsAndFlopsDataModel

getStateModel

public StateModel getStateModel()
Description copied from class: Control
Returns the state model of the control

Specified by:
getStateModel in class Control
Returns:
The state model
See Also:
Control.getStateModel()

size

public int size()
Specified by:
size in interface RatingDataModel
Returns:
returns the number of rating items in this data model
See Also:
RatingDataModel.size()

getItem

public RatingItem getItem(int index)
Description copied from interface: RatingDataModel
Retrieves the rating item with the given index

Specified by:
getItem in interface RatingDataModel
Parameters:
index - zero based index
Returns:
the rating item
See Also:
RatingDataModel.getItem(int)

getTotalValue

public long getTotalValue()
Description copied from interface: RatingDataModel
Retrieves the total value (=100%) for the control. When the method returns 0 the control will calculate it's own total value by adding the single values of all rating items.

Specified by:
getTotalValue in interface RatingDataModel
Returns:
the 100% value or 0 when the control should calculate the total value based on the single rating items
See Also:
RatingDataModel.getTotalValue()

getFilter

public boolean getFilter()
Returns the Filter setting

Returns:
boolean

getImageMap

public ImageMap getImageMap()
Returns the associated ImageMap

Returns:
ImageMap or null

getEmptyText

public java.lang.String getEmptyText()
A text that is output in the body of the rating element if there are no elements available (size() == 0)

Returns:
String

onItemClick

public void onItemClick(ControlRequestContext ctx,
                        java.lang.String key)
                 throws java.lang.Exception
Default handler for the ItemCLick Event

Parameters:
ctx - ControlRequestContext
key - Unique Id as generated by the data model to identify the Row
Throws:
java.lang.Exception - is thrown when an error occurs


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.