com.cc.framework.ui.control
Class TreeSwapSelectControl

java.lang.Object
  extended bycom.cc.framework.ui.control.Control
      extended bycom.cc.framework.ui.control.TreeSwapSelectControl
All Implemented Interfaces:
AccessControlled, ActionBehavior, ClientHandler, DataModel, java.io.Serializable, StateModel, TreeSwapSelectDataModel, TreeSwapSelectStateModel

public class TreeSwapSelectControl
extends Control
implements TreeSwapSelectStateModel, TreeSwapSelectDataModel

Control element for the tree select element with two windows

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

Field Summary
private  java.lang.String body
          Additional HTML Body
private  TreeSwapSelectDesignModel designModel
          The design model
private  java.lang.Object optionElements
          The Option elements
private  OptionListDesignModel options
          The option list
private static long serialVersionUID
          Serial Version UID
private  java.lang.Object[] values
          Text Value
 
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
TreeSwapSelectControl()
          Constructor
TreeSwapSelectControl(TreeSwapSelectDesignModel designModel)
          Constructor
 
Method Summary
 boolean filter()
          Returns if the filter is activated (default=true).
 java.lang.String getBody()
          Returns the optional HTML Body of the control
 DataModel getDataModel()
          Returns the data model of the Control
 ControlDesignModel getDesignModel()
          Returns the design model of the control
 java.lang.String getLabelLeft()
          Retrieves the label for the left selection window
 java.lang.String[] getLabelRight()
          Retrieves the label for the right selection window
 java.lang.Object getOptionElements()
          Returns the Option elements
 OptionListDesignModel getOptions()
          Returns the option list.
 OrientationType getOrientation()
          Retrieves the orientation of the selection windows
 int[] getSize()
          Returns the Size (Number of visible items) for each select box
 SortOrder getSortOrder()
          Retrieves the sort order of the control
 StateModel getStateModel()
          Returns the state model of the control
 java.lang.Object[] getValues()
          Returns the keys for the selected Item
 boolean isMultiple()
           
 void onSwapAll(ControlRequestContext ctx, int direction)
          Event handler for the swap all options button
 void onSwapSelected(ControlRequestContext ctx, int direction)
          Event handler for the swap selected options button
 void reset()
          Resets the actual state of a control to the initial state
 boolean retainOrder()
           
 void setBody(java.lang.String string)
          Sets the optional HTML Body of the control.
 void setDesignModel(TreeSwapSelectDesignModel designModel)
          Sets the DesignModel
 void setOptions(OptionListDesignModel options, java.lang.Object elements)
          Sets a option list.
 void setValues(java.lang.Object[] values)
          Sets the key for the selected Item
 boolean showButton(ControlButton button)
          This Method is called by the Painter before rendering a Button.
 boolean showLabels()
          Checks if the labels should be visible
 
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, 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

designModel

private TreeSwapSelectDesignModel designModel
The design model


values

private java.lang.Object[] values
Text Value


options

private OptionListDesignModel options
The option list


body

private java.lang.String body
Additional HTML Body


optionElements

private java.lang.Object optionElements
The Option elements

Constructor Detail

TreeSwapSelectControl

public TreeSwapSelectControl()
Constructor


TreeSwapSelectControl

public TreeSwapSelectControl(TreeSwapSelectDesignModel designModel)
Constructor

Parameters:
designModel - SelectDesignModel
Method Detail

setDesignModel

public void setDesignModel(TreeSwapSelectDesignModel designModel)
Sets the DesignModel

Parameters:
designModel - SwapSelectDesignModel

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()

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()

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()

getValues

public java.lang.Object[] getValues()
Description copied from interface: TreeSwapSelectDataModel
Returns the keys for the selected Item

Specified by:
getValues in interface TreeSwapSelectDataModel
Returns:
String
See Also:
TreeSwapSelectDataModel.getValues()

setValues

public void setValues(java.lang.Object[] values)
Description copied from interface: TreeSwapSelectDataModel
Sets the key for the selected Item

Specified by:
setValues in interface TreeSwapSelectDataModel
Parameters:
values - Values (item to be selected)
See Also:
TreeSwapSelectDataModel.setValues(java.lang.Object[])

getOptions

public OptionListDesignModel getOptions()
Returns the option list.

Returns:
OptionListDesignModel

setOptions

public void setOptions(OptionListDesignModel options,
                       java.lang.Object elements)
Sets a option list.

Parameters:
options - The options to set
elements - The Option elements

getOptionElements

public java.lang.Object getOptionElements()
Returns the Option elements

Returns:
Elements

getSize

public int[] getSize()
Returns the Size (Number of visible items) for each select box

Returns:
integer

getBody

public java.lang.String getBody()
Returns the optional HTML Body of the control

Returns:
HTML string

setBody

public void setBody(java.lang.String string)
Sets the optional HTML Body of the control.

Parameters:
string - HTML String

getLabelLeft

public java.lang.String getLabelLeft()
Retrieves the label for the left selection window

Returns:
the label

getLabelRight

public java.lang.String[] getLabelRight()
Retrieves the label for the right selection window

Returns:
the label

showLabels

public boolean showLabels()
Checks if the labels should be visible

Returns:
true if the labels should be visible

retainOrder

public boolean retainOrder()
Returns:
returns when the control should retain the sort order in the "from" option list

isMultiple

public boolean isMultiple()
Returns:
returns true when the control should be rendered as a multiple swap select control with multiple shift targets

getOrientation

public OrientationType getOrientation()
Retrieves the orientation of the selection windows

Returns:
the orientation

getSortOrder

public SortOrder getSortOrder()
Retrieves the sort order of the control

Returns:
the sort order

filter

public boolean filter()
Returns if the filter is activated (default=true). This means that all Strings which should be displayed in the HTML page are HTML encoded

Returns:
true if string will be HTML encoded; false otherwise

showButton

public boolean showButton(ControlButton button)
Description copied from class: Control
This Method is called by the Painter before rendering a Button. By overwriting this method a derived class can show or hide buttons.

Overrides:
showButton in class Control
Parameters:
button - ControlButton
Returns:
boolean
See Also:
Control.showButton(com.cc.framework.ui.control.ControlButton)

onSwapSelected

public void onSwapSelected(ControlRequestContext ctx,
                           int direction)
                    throws java.lang.Exception
Event handler for the swap selected options button

Parameters:
ctx - ControlRequestContext
direction - the direction where to move selected elements
  • -1 = remove selected elements
  • 1 = add selected elements
Throws:
java.lang.Exception - is thrown when an error occurs

onSwapAll

public void onSwapAll(ControlRequestContext ctx,
                      int direction)
               throws java.lang.Exception
Event handler for the swap all options button

Parameters:
ctx - ControlRequestContext
direction - the direction where to move all elements
  • -1 = remove all elements
  • 1 = add all elements
Throws:
java.lang.Exception - is thrown when an error occurs


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