com.cc.framework.ui.model.imp
Class ControlDesignModelImp

java.lang.Object
  extended bycom.cc.framework.ui.model.imp.ClientHandlerImp
      extended bycom.cc.framework.ui.model.imp.ControlDesignModelImp
All Implemented Interfaces:
AccessControlled, ActionBehavior, AjaxSupport, ClientHandler, ControlDesignModel, DesignModel, java.io.Serializable
Direct Known Subclasses:
ButtonDesignModelImp, CheckboxDesignModelImp, CheckboxGroupDesignModelImp, ComboBoxDesignModelImp, ControlContainerImp, CrumbsDesignModelImp, FormDesignModelImp, FrameDesignModelImp, GaugeDesignModelImp, HeadlineDesignModelImp, InfoDesignModelImp, ListDesignModelImp, MenuDesignModelImp, MessageDesignModelImp, PanelDesignModelImp, RatingDesignModelImp, RecurrencePatternDesignModelImp, SchedulerDesignModelImp, SelectDesignModelImp, SwapSelectDesignModelImp, TabsetDesignModelImp, TextareaDesignModelImp, TextDesignModelImp, TextListDesignModelImp, TreeDesignModelImp, TreeSwapSelectDesignModelImp

public abstract class ControlDesignModelImp
extends ClientHandlerImp
implements ControlDesignModel, java.io.Serializable

Base Class for all control design models

Since:
1.0
Version:
$Revision: 1.28 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  java.lang.String action
          The Action assigned with the Control
private  boolean ajax
          set to true to enable AJAX.
private  int border
          Border which should be drawn around the Control
private  java.util.ArrayList designRules
          Design rules
private  boolean disabled
          Indicates if the Control is disabled
private  boolean dynamic
          Indicates if the Design model was created dynamically in the JSP-Page.
private  boolean formElement
          Indicates if the control always should submit the form
private  java.lang.String height
          Height of the Control
private  java.lang.String help
          The Help Identifier for this control
private  java.lang.String id
          Unique Id
private  java.lang.String localeName
          Locale Setting
private  java.lang.String name
          The name of the Bean used for the Control
private  Permission permission
          The Permission for the Control
private  java.lang.String property
          Field property
private  RunAt runat
          Indicates where to execute the Eventhandler.
private static long serialVersionUID
          Serial Version UID
private  boolean shadow
          Indicates if the Control should render a shadow
private  java.lang.String style
          THML-Style
private  java.lang.String styleClass
          Style Class -> HTML class attribute
private  java.lang.String styleId
          Style ID
private  java.lang.String summary
          specifies a description and/or structure of the object That can be used for rendering to non-visual media such as speech or Braille.
private  int tabIndex
          Tabulator Index
private  java.lang.String tooltip
          Tooltip
private  boolean transaction
          Directs the framework to include a transaction token (if any) in all generated hyperlinks for this column.
private  java.lang.String width
          Width of the Control
 
Fields inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
 
Constructor Summary
ControlDesignModelImp()
          Constructor
 
Method Summary
 void addDesignRule(DesignRule rule)
          Adds a new design rule to the control
 void enableAjax(boolean enable)
          Enables or disables the AJAX behavior of the element
 java.lang.String getAction()
          Returns the action which is assigned to the control
 int getBorder()
          Returns the border width
 DesignRule[] getDesignRules()
          Returns the design rules for this control
 java.lang.String getHeight()
          Returns the height of the control
 java.lang.String getHelp()
          Returns the Help id that is associated with this control element.
 java.lang.String getId()
          Returns the id of the control
 java.lang.String getLocaleName()
          Gets the Local Setting for this Control
 java.lang.String getName()
          Returns the name of the element (bean)
 Permission getPermission()
          Returns the authorizations required to access an object If the method returns null no access rights is required.
 java.lang.String getProperty()
          Returns the Property Attribute
 RunAt getRunAt()
          Returns if the control works with or without server round trips.
 java.lang.String getStyle()
          Returns the Style
 java.lang.String getStyleClass()
          Returns the StyleClass
 java.lang.String getStyleId()
          returns the StyleId
 java.lang.String getSummary()
          Retrieves the property that can be used for rendering to non-visual media such as speech or Braille
 int getTabIndex()
          Returns the Tab index
 java.lang.String getTooltip()
          Retrieves the optional tooltip text
 boolean getTransaction()
          Checks if the framework should include a transaction token (if any) in all generated hyperlinks.
 java.lang.String getWidth()
          Returns the width of the control
 boolean hasShadow()
          Returns if the control uses a shadow
 boolean isAjaxEnabled()
          This method checks if the element should send AJAX requests to the server
 boolean isDisabled()
          Returns the disabled Flag
 boolean isDynamicDesignModel()
          Checks if the design model was declared within the JSP or (design time) it was predetermined by the programmer (run time).
 boolean isFormElement()
          Checks if the control should act like a form element.
 void setAction(java.lang.String action)
          Sets the action, which should be performed, if an event of a control occur.
 void setBorder(int border)
          Sets the border width
 void setDisabled(boolean disabled)
          Sets the disabled Flag
 void setDynamicDesignModel(boolean dynamic)
          Sets if the design model was declared within the JSP or (design time) it was predetermined by the programmer (run time).
 void setFormElement(boolean flag)
          Defines if the control should act like a form element.
 void setHeight(java.lang.String height)
          Sets the height of the control
 void setHelp(java.lang.String helpId)
          Associates this control with a help id
 void setId(java.lang.String id)
          Sets the unique Id for the Control
 void setLocaleName(java.lang.String locale)
          Sets the Locale configuration for this control
 void setName(java.lang.String name)
          Sets the name of the element (bean)
 void setPermission(Permission permission)
          Sets a list with permission for the object.
 void setProperty(java.lang.String property)
          Sets the Property
 void setRunAt(RunAt location)
          Specified if the control should work with or without server round trips
 void setShadow(boolean shadow)
          Sets the shadow for a control
 void setStyle(java.lang.String style)
          Sets the Style
 void setStyleClass(java.lang.String styleClass)
          Sets the StyleClass
 void setStyleId(java.lang.String styleId)
          Sets the StyleId
 void setSummary(java.lang.String summary)
          Sets the property that can be used for rendering to non-visual media such as speech or Braille
 void setTabIndex(int tabIndex)
          Sets the Tab index
 void setTooltip(java.lang.String tooltip)
          Sets the optional tooltip text
 void setTransaction(boolean transaction)
          Directs the framework to include a transaction token (if any) in all generated hyperlinks.
 void setWidth(java.lang.String width)
          Sets the Width of the Control
 boolean show(Principal principal)
          Checks if the Object has a required permission.
 
Methods inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
evaluate, getHandler, getHandlers, setHandler
 
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.ClientHandler
getHandler, getHandlers, setHandler
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

dynamic

private boolean dynamic
Indicates if the Design model was created dynamically in the JSP-Page. Dynamic created Design models can be overridden by a server Roundtrip


runat

private RunAt runat
Indicates where to execute the Eventhandler.


name

private java.lang.String name
The name of the Bean used for the Control


property

private java.lang.String property
Field property


action

private java.lang.String action
The Action assigned with the Control


id

private java.lang.String id
Unique Id


height

private java.lang.String height
Height of the Control


width

private java.lang.String width
Width of the Control


border

private int border
Border which should be drawn around the Control


disabled

private boolean disabled
Indicates if the Control is disabled


shadow

private boolean shadow
Indicates if the Control should render a shadow


permission

private Permission permission
The Permission for the Control


styleId

private java.lang.String styleId
Style ID


styleClass

private java.lang.String styleClass
Style Class -> HTML class attribute


style

private java.lang.String style
THML-Style


help

private java.lang.String help
The Help Identifier for this control


tooltip

private java.lang.String tooltip
Tooltip


summary

private java.lang.String summary
specifies a description and/or structure of the object That can be used for rendering to non-visual media such as speech or Braille.


tabIndex

private int tabIndex
Tabulator Index


formElement

private boolean formElement
Indicates if the control always should submit the form


localeName

private java.lang.String localeName
Locale Setting


designRules

private java.util.ArrayList designRules
Design rules


transaction

private boolean transaction
Directs the framework to include a transaction token (if any) in all generated hyperlinks for this column. The Transaction token is used to track form re-submissions.When set to null the namespace will be searched for the Globals.TRANSACTION_KEY key


ajax

private boolean ajax
set to true to enable AJAX.

Constructor Detail

ControlDesignModelImp

public ControlDesignModelImp()
Constructor

Method Detail

isDynamicDesignModel

public boolean isDynamicDesignModel()
Description copied from interface: ControlDesignModel
Checks if the design model was declared within the JSP or (design time) it was predetermined by the programmer (run time).

Specified by:
isDynamicDesignModel in interface ControlDesignModel
Returns:
true - The design model was set within a JSP page false - The design model was set by the programmer (server side)
See Also:
ControlDesignModel.isDynamicDesignModel()

setDynamicDesignModel

public void setDynamicDesignModel(boolean dynamic)
Description copied from interface: ControlDesignModel
Sets if the design model was declared within the JSP or (design time) it was predetermined by the programmer (run time). The framework will use this information to detect if a design model can be created new if a server round trip occurred and if the server side design model should not be changed.

Specified by:
setDynamicDesignModel in interface ControlDesignModel
Parameters:
dynamic - true if the design model was declared within the JSP page.
See Also:
ControlDesignModel.setDynamicDesignModel(boolean)

getHeight

public java.lang.String getHeight()
Description copied from interface: ControlDesignModel
Returns the height of the control

Specified by:
getHeight in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getHeight()

getId

public java.lang.String getId()
Description copied from interface: ControlDesignModel
Returns the id of the control

Specified by:
getId in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getId()

getWidth

public java.lang.String getWidth()
Description copied from interface: ControlDesignModel
Returns the width of the control

Specified by:
getWidth in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getWidth()

setHeight

public void setHeight(java.lang.String height)
Description copied from interface: ControlDesignModel
Sets the height of the control

Specified by:
setHeight in interface ControlDesignModel
Parameters:
height - Height
See Also:
ControlDesignModel.setHeight(String height)

setId

public void setId(java.lang.String id)
Description copied from interface: ControlDesignModel
Sets the unique Id for the Control

Specified by:
setId in interface ControlDesignModel
Parameters:
id - Id
See Also:
ControlDesignModel.setId(String id)

setWidth

public void setWidth(java.lang.String width)
Description copied from interface: ControlDesignModel
Sets the Width of the Control

Specified by:
setWidth in interface ControlDesignModel
Parameters:
width - Width
See Also:
ControlDesignModel.setWidth(String width)

setAction

public void setAction(java.lang.String action)
Description copied from interface: ControlDesignModel
Sets the action, which should be performed, if an event of a control occur.

Specified by:
setAction in interface ControlDesignModel
Parameters:
action - Action
See Also:
ControlDesignModel.setAction(String)

getAction

public java.lang.String getAction()
Description copied from interface: ControlDesignModel
Returns the action which is assigned to the control

Specified by:
getAction in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getAction()

getName

public java.lang.String getName()
Description copied from interface: ControlDesignModel
Returns the name of the element (bean)

Specified by:
getName in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: ControlDesignModel
Sets the name of the element (bean)

Specified by:
setName in interface ControlDesignModel
Parameters:
name - Name
See Also:
ControlDesignModel.setName(java.lang.String)

getProperty

public java.lang.String getProperty()
Description copied from interface: ControlDesignModel
Returns the Property Attribute

Specified by:
getProperty in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getProperty()

setProperty

public void setProperty(java.lang.String property)
Description copied from interface: ControlDesignModel
Sets the Property

Specified by:
setProperty in interface ControlDesignModel
Parameters:
property - Property name
See Also:
ControlDesignModel.setProperty(String)

getBorder

public int getBorder()
Description copied from interface: ControlDesignModel
Returns the border width

Specified by:
getBorder in interface ControlDesignModel
Returns:
integer
See Also:
ControlDesignModel.getBorder()

setBorder

public void setBorder(int border)
Description copied from interface: ControlDesignModel
Sets the border width

Specified by:
setBorder in interface ControlDesignModel
Parameters:
border - Border
See Also:
ControlDesignModel.setBorder(int)

hasShadow

public boolean hasShadow()
Description copied from interface: ControlDesignModel
Returns if the control uses a shadow

Specified by:
hasShadow in interface ControlDesignModel
Returns:
boolean
See Also:
ControlDesignModel.hasShadow()

setShadow

public void setShadow(boolean shadow)
Description copied from interface: ControlDesignModel
Sets the shadow for a control

Specified by:
setShadow in interface ControlDesignModel
Parameters:
shadow - true if the control should render a shadow
See Also:
ControlDesignModel.setShadow(boolean)

getPermission

public Permission getPermission()
Description copied from interface: AccessControlled
Returns the authorizations required to access an object If the method returns null no access rights is required.

Specified by:
getPermission in interface AccessControlled
Returns:
Permission A list with required permissions separated by ";"
See Also:
AccessControlled.getPermission()

setPermission

public void setPermission(Permission permission)
Description copied from interface: ControlDesignModel
Sets a list with permission for the object. Permissions are separated by ';'

Specified by:
setPermission in interface ControlDesignModel
Parameters:
permission - Permission
See Also:
ControlDesignModel.setPermission(com.cc.framework.security.Permission)

show

public boolean show(Principal principal)
Description copied from interface: AccessControlled
Checks if the Object has a required permission.

Specified by:
show in interface AccessControlled
Parameters:
principal - the users principal object
Returns:
true if the permission exists
See Also:
AccessControlled.show(Principal)

setRunAt

public void setRunAt(RunAt location)
Description copied from interface: ControlDesignModel
Specified if the control should work with or without server round trips

Specified by:
setRunAt in interface ControlDesignModel
Parameters:
location - where the action should be executed.
See Also:
ControlDesignModel.setRunAt(RunAt)

getRunAt

public RunAt getRunAt()
Description copied from interface: ControlDesignModel
Returns if the control works with or without server round trips.

Specified by:
getRunAt in interface ControlDesignModel
Returns:
RunAt
See Also:
ControlDesignModel.getRunAt()

setFormElement

public void setFormElement(boolean flag)
Description copied from interface: ControlDesignModel
Defines if the control should act like a form element.

Specified by:
setFormElement in interface ControlDesignModel
Parameters:
flag - true if the control should act like a form element.
See Also:
ControlDesignModel.setFormElement(boolean)

isFormElement

public boolean isFormElement()
Description copied from interface: ControlDesignModel
Checks if the control should act like a form element. In this case all action on the control must result in a submission of the enclosing form. This means that the data which is required to detected the actual action on the control (drilldown, edit, ...) must be submit as form data and can not attached to the URL.

Specified by:
isFormElement in interface ControlDesignModel
Returns:
true if the control acts like a form element.
See Also:
ControlDesignModel.isFormElement()

getStyle

public java.lang.String getStyle()
Description copied from interface: ControlDesignModel
Returns the Style

Specified by:
getStyle in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getStyle()

getStyleId

public java.lang.String getStyleId()
Description copied from interface: ControlDesignModel
returns the StyleId

Specified by:
getStyleId in interface ControlDesignModel
Returns:
string
See Also:
ControlDesignModel.getStyleId()

setStyle

public void setStyle(java.lang.String style)
Description copied from interface: ControlDesignModel
Sets the Style

Specified by:
setStyle in interface ControlDesignModel
Parameters:
style - Style constant
See Also:
ControlDesignModel.setStyle(String style)

setStyleId

public void setStyleId(java.lang.String styleId)
Description copied from interface: ControlDesignModel
Sets the StyleId

Specified by:
setStyleId in interface ControlDesignModel
Parameters:
styleId - HTML-Id of the element
See Also:
ControlDesignModel.setStyleId(String styleId)

getHelp

public java.lang.String getHelp()
Description copied from interface: ControlDesignModel
Returns the Help id that is associated with this control element. If a control has a help id a little icon with a link to the help system will be created

Specified by:
getHelp in interface ControlDesignModel
Returns:
String returns the Help id of the element. The semantic of this id is completely in the responsibility of the applications help system
See Also:
ControlDesignModel.getHelp()

setHelp

public void setHelp(java.lang.String helpId)
Description copied from interface: ControlDesignModel
Associates this control with a help id

Specified by:
setHelp in interface ControlDesignModel
Parameters:
helpId - The Help Help id of the element. The semantic of this id is completely in the responsibility of the applications help system
See Also:
ControlDesignModel.setHelp(java.lang.String)

isDisabled

public boolean isDisabled()
Description copied from interface: ControlDesignModel
Returns the disabled Flag

Specified by:
isDisabled in interface ControlDesignModel
Returns:
boolean
See Also:
ControlDesignModel.isDisabled()

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: ControlDesignModel
Sets the disabled Flag

Specified by:
setDisabled in interface ControlDesignModel
Parameters:
disabled - true if the control should be rendered as inactive
See Also:
ControlDesignModel.setDisabled(boolean disabled)

getStyleClass

public java.lang.String getStyleClass()
Description copied from interface: ControlDesignModel
Returns the StyleClass

Specified by:
getStyleClass in interface ControlDesignModel
Returns:
String
See Also:
ControlDesignModel.getStyleClass()

setStyleClass

public void setStyleClass(java.lang.String styleClass)
Description copied from interface: ControlDesignModel
Sets the StyleClass

Specified by:
setStyleClass in interface ControlDesignModel
Parameters:
styleClass - StyleClass
See Also:
ControlDesignModel.setStyleClass(String styleClass)

getTabIndex

public int getTabIndex()
Description copied from interface: ControlDesignModel
Returns the Tab index

Specified by:
getTabIndex in interface ControlDesignModel
Returns:
integer
See Also:
ControlDesignModel.getTabIndex()

setTabIndex

public void setTabIndex(int tabIndex)
Description copied from interface: ControlDesignModel
Sets the Tab index

Specified by:
setTabIndex in interface ControlDesignModel
Parameters:
tabIndex - Index
See Also:
ControlDesignModel.setTabIndex(int)

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the optional tooltip text

Specified by:
setTooltip in interface ControlDesignModel
Parameters:
tooltip - Tooltip

getTooltip

public java.lang.String getTooltip()
Retrieves the optional tooltip text

Specified by:
getTooltip in interface ControlDesignModel
Returns:
tooltip text or null

getSummary

public java.lang.String getSummary()
Description copied from interface: ControlDesignModel
Retrieves the property that can be used for rendering to non-visual media such as speech or Braille

Specified by:
getSummary in interface ControlDesignModel
Returns:
receives a description and/or structure of the object or null
See Also:
ControlDesignModel.getSummary()

setSummary

public void setSummary(java.lang.String summary)
Description copied from interface: ControlDesignModel
Sets the property that can be used for rendering to non-visual media such as speech or Braille

Specified by:
setSummary in interface ControlDesignModel
Parameters:
summary - specifies a description and/or structure of the object.
See Also:
ControlDesignModel.setSummary(java.lang.String)

getTransaction

public boolean getTransaction()
Description copied from interface: ControlDesignModel
Checks if the framework should include a transaction token (if any) in all generated hyperlinks. The Transaction token is used to track form re-submissions.

Specified by:
getTransaction in interface ControlDesignModel
Returns:
true if the transaction token should be generated
See Also:
ControlDesignModel.getTransaction()

setTransaction

public void setTransaction(boolean transaction)
Description copied from interface: ControlDesignModel
Directs the framework to include a transaction token (if any) in all generated hyperlinks. The Transaction token is used to track form re-submissions.

Specified by:
setTransaction in interface ControlDesignModel
Parameters:
transaction - include transaction token
See Also:
ControlDesignModel.setTransaction(boolean)

isAjaxEnabled

public boolean isAjaxEnabled()
Description copied from interface: ActionBehavior
This method checks if the element should send AJAX requests to the server

Specified by:
isAjaxEnabled in interface ActionBehavior
Returns:
returns true when the control should send AJAX requests.
See Also:
ActionBehavior.isAjaxEnabled()

enableAjax

public void enableAjax(boolean enable)
Description copied from interface: AjaxSupport
Enables or disables the AJAX behavior of the element

Specified by:
enableAjax in interface AjaxSupport
Parameters:
enable - set to true to enable AJAX.
See Also:
AjaxSupport.enableAjax(boolean)

setLocaleName

public void setLocaleName(java.lang.String locale)
Description copied from interface: ControlDesignModel
Sets the Locale configuration for this control

Specified by:
setLocaleName in interface ControlDesignModel
Parameters:
locale - Locale Identifier or true|false
See Also:
ControlDesignModel.setLocaleName(java.lang.String)

getLocaleName

public java.lang.String getLocaleName()
Description copied from interface: ControlDesignModel
Gets the Local Setting for this Control

Specified by:
getLocaleName in interface ControlDesignModel
Returns:
Locale Setting
See Also:
ControlDesignModel.getLocaleName()

addDesignRule

public void addDesignRule(DesignRule rule)
Description copied from interface: ControlDesignModel
Adds a new design rule to the control

Specified by:
addDesignRule in interface ControlDesignModel
Parameters:
rule - Design rule
See Also:
ControlDesignModel.addDesignRule(com.cc.framework.ui.model.DesignRule)

getDesignRules

public DesignRule[] getDesignRules()
Description copied from interface: ControlDesignModel
Returns the design rules for this control

Specified by:
getDesignRules in interface ControlDesignModel
Returns:
Array of design rules
See Also:
ControlDesignModel.getDesignRules()


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