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

java.lang.Object
  extended bycom.cc.framework.ui.model.imp.ClientHandlerImp
      extended bycom.cc.framework.ui.model.imp.ControlDesignModelImp
          extended bycom.cc.framework.ui.model.imp.FormDesignModelImp
All Implemented Interfaces:
AccessControlled, ActionBehavior, AjaxSupport, ButtonContainer, ClientHandler, ControlDesignModel, DesignModel, FormDesignModel, FormElement, FormElementContainer, FrameContainer, java.io.Serializable

public class FormDesignModelImp
extends ControlDesignModelImp
implements FormDesignModel

Designmodel for forms

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

Field Summary
private  ButtonContainer buttons
          The users permission which is necessary to see any buttons
private  java.lang.String caption
          The title of the form
private  java.lang.String cellWidth
          The width of the cell area for this container
private  FormGroupElement container
          Container for the form elements
private  java.lang.String detail
          The forms subtitle
private  java.lang.String expandProperty
          The (optional) name of a property that is used to expand or collapse the group
private  java.lang.String formid
          The unique Id of the form
private  java.util.ArrayList frames
          Inner Frames
private  ImageModel image
          The optional title image
private  ImageMap imagemap
          The ImageMap which can be used to paint icons in front of the labels.
private  java.lang.String labelPrefix
          optional label prefix in plain HTML
private  java.lang.String labelSuffix
          optional label suffix in plain HTML
private  java.lang.String labelWidth
          The width of the label area for this container
private  FormMethod method
          Method to submit the form
private static long serialVersionUID
          Serial Version UID
private  boolean showFrame
          Enables or disables the forms frame
private  FormType type
          Type of the form
 
Fields inherited from class com.cc.framework.ui.model.imp.ControlDesignModelImp
 
Fields inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
 
Constructor Summary
FormDesignModelImp()
          Constructor for FormDesignModelImp
 
Method Summary
 void addFormElement(FormElement element)
          Adds a new child element to the container
 void addInnerFrame(InnerFrame frame)
          Adds a inner frame to the List
 AlignmentType getAlignment()
          Returns the horizontal alignment
 Permission getButtonPermission(ControlButton button)
          Retrieves the permission for the given button
 java.lang.String getCaption()
          Returns the Caption of the Form
 java.lang.String getCellWidth()
          Returns the width of the control cell for this container.
 int getColSpan()
          Returns the column span for this element
 FormColumnGroup getColumnGroup()
           
 java.lang.String getDetail()
          Returns the Detail, which is displayed right of the Caption
 java.lang.String getExpandProperty()
          Retrieves the name of a property that is used to expand or collapse the group
 FormElement getFormElement(int index)
          Returns a single elements in the container
 FormElement[] getFormElements()
          Returns a list with all elements in the container
 FormElement[] getFormElements(Principal principal)
          Returns a list with all visible elements in the container filtered on the principals permissions
 java.lang.String getFormId()
          Returns the form identifier
 FormType getFormType()
          Returns the FormType
 ImageModel getImage()
          Returns the image for the frames title
 ImageMap getImageMap()
          Returns the ImageMap
 InnerFrame[] getInnerFrames(Principal principal, java.lang.Object layoutHint)
          Retrieves a list of only the inner frames that are matching the given layout hint
 java.lang.String getLabelPrefix()
          Retrieves the optional label prefix in plain HTML.
 java.lang.String getLabelSuffix()
          Retrieves the optional label suffix in plain HTML.
 java.lang.String getLabelWidth()
          Returns the width of the labels for this container.
 FormMethod getMethod()
          Returns in which way Data should by submitted to the Server.
 boolean getNoWrap()
          Indicates that the form element cell should not be wrapped
 OrientationType getOrientation()
           
 FormElementContainer getParent()
           
 AlignmentType getVAlignment()
          Returns the vertical alignment
 boolean joinElements()
          This method returns true when two adjacent form elements should be joined together without a separator
 void removeFormElement(FormElement element)
          Removes the specified form element from the container
 void setAlignment(AlignmentType alignment)
          Specifies the horizontal alignment of the form element within the form left right center
 void setButtonPermission(ControlButton button, Permission permission)
          Sets whether a command button should be displayed by specifying an Access Control List.
 void setCaption(java.lang.String caption)
          Sets the Caption
 void setCellWidth(java.lang.String width)
          Sets the width of the control cell for this container.
 void setColSpan(int colspan)
          Sets the column span of this form element
 void setDetail(java.lang.String detail)
          Sets the Detail
 void setExpandProperty(java.lang.String propertyName)
          Sets the name of a property that is used to expand or collapse the group
 void setFormId(java.lang.String formid)
          Sets the form identifier
 void setFormType(FormType type)
          Sets the FormType
 void setImage(ImageModel img)
          Sets an image for the frames title
 void setImageMap(ImageMap imagemap)
          Sets the ImageMap
 void setJoin(boolean join)
          This method specifies that two adjacent form elements should be joined together without a separator
 void setLabelPrefix(java.lang.String prefix)
          Specifies the label prefix in plain HTML.
 void setLabelSuffix(java.lang.String suffix)
          Specifies the label suffix in plain HTML.
 void setLabelWidth(java.lang.String width)
          Sets the width of the labels for this container.
 void setMethod(FormMethod method)
          Sets the FormMethod
 void setParent(FormElementContainer parent)
           
 void setShowFrame(boolean show)
          Disables the forms border
 void setVAlignment(AlignmentType valignment)
          Specifies the vertical alignment of the form element within the form top bottom center
 boolean showButton(ControlButton button, Principal principal)
          Checks if the button can be displayed.
 boolean showFrame()
           
 int size()
          Returns the number of elements in the container
 
Methods inherited from class com.cc.framework.ui.model.imp.ControlDesignModelImp
addDesignRule, enableAjax, getAction, getBorder, getDesignRules, getHeight, getHelp, getId, getLocaleName, getName, getPermission, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getWidth, hasShadow, isAjaxEnabled, isDisabled, isDynamicDesignModel, isFormElement, setAction, setBorder, setDisabled, setDynamicDesignModel, setFormElement, setHeight, setHelp, setId, setLocaleName, setName, setPermission, setProperty, setRunAt, setShadow, setStyle, setStyleClass, setStyleId, setSummary, setTabIndex, setTooltip, setTransaction, setWidth, show
 
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.FormDesignModel
getAction, setAction
 
Methods inherited from interface com.cc.framework.ui.model.ControlDesignModel
addDesignRule, getBorder, getDesignRules, getHeight, getHelp, getId, getLocaleName, getName, getProperty, getRunAt, getStyle, getStyleClass, getStyleId, getSummary, getTabIndex, getTooltip, getTransaction, getWidth, hasShadow, isDisabled, isDynamicDesignModel, isFormElement, setBorder, setDisabled, setDynamicDesignModel, setFormElement, setHeight, setHelp, setId, setLocaleName, setName, setPermission, setProperty, setRunAt, setShadow, setStyle, setStyleClass, setStyleId, setSummary, setTabIndex, setTooltip, setTransaction, setWidth
 
Methods inherited from interface com.cc.framework.ui.model.ClientHandler
getHandler, getHandlers, setHandler
 
Methods inherited from interface com.cc.framework.ui.model.AccessControlled
getPermission, show
 
Methods inherited from interface com.cc.framework.ui.model.ActionBehavior
isAjaxEnabled
 
Methods inherited from interface com.cc.framework.ui.model.AjaxSupport
enableAjax, isAjaxEnabled
 
Methods inherited from interface com.cc.framework.ui.control.FormElement
getHeight, getHelp, getStyle, getStyleClass, getStyleId, getWidth, setHeight, setHelp, setStyle, setStyleClass, setStyleId, setWidth
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

type

private FormType type
Type of the form


method

private FormMethod method
Method to submit the form


caption

private java.lang.String caption
The title of the form


detail

private java.lang.String detail
The forms subtitle


formid

private java.lang.String formid
The unique Id of the form


labelSuffix

private java.lang.String labelSuffix
optional label suffix in plain HTML


labelPrefix

private java.lang.String labelPrefix
optional label prefix in plain HTML


labelWidth

private java.lang.String labelWidth
The width of the label area for this container


cellWidth

private java.lang.String cellWidth
The width of the cell area for this container


imagemap

private ImageMap imagemap
The ImageMap which can be used to paint icons in front of the labels.


showFrame

private boolean showFrame
Enables or disables the forms frame


image

private ImageModel image
The optional title image


expandProperty

private java.lang.String expandProperty
The (optional) name of a property that is used to expand or collapse the group


container

private FormGroupElement container
Container for the form elements


buttons

private ButtonContainer buttons
The users permission which is necessary to see any buttons


frames

private java.util.ArrayList frames
Inner Frames

Constructor Detail

FormDesignModelImp

public FormDesignModelImp()
Constructor for FormDesignModelImp

Method Detail

getParent

public FormElementContainer getParent()
Specified by:
getParent in interface FormElement
Returns:
returns the parent container or null when this is the top most container
See Also:
FormElement.getParent()

setParent

public void setParent(FormElementContainer parent)
Specified by:
setParent in interface FormElement
Parameters:
parent - the parent form element container for this element
See Also:
FormElement.setParent(com.cc.framework.ui.control.FormElementContainer)

getMethod

public FormMethod getMethod()
Description copied from interface: FormDesignModel
Returns in which way Data should by submitted to the Server.

Specified by:
getMethod in interface FormDesignModel
Returns:
FormMethod
See Also:
FormDesignModel.getMethod()

setMethod

public void setMethod(FormMethod method)
Description copied from interface: FormDesignModel
Sets the FormMethod

Specified by:
setMethod in interface FormDesignModel
Parameters:
method - FormMethod
See Also:
FormDesignModel.setMethod(FormMethod method)

getCaption

public java.lang.String getCaption()
Description copied from interface: FormDesignModel
Returns the Caption of the Form

Specified by:
getCaption in interface FormDesignModel
Returns:
String
See Also:
FormDesignModel.getCaption()

setCaption

public void setCaption(java.lang.String caption)
Description copied from interface: FormDesignModel
Sets the Caption

Specified by:
setCaption in interface FormDesignModel
Parameters:
caption - Caption
See Also:
FormDesignModel.setCaption(java.lang.String)

getDetail

public java.lang.String getDetail()
Description copied from interface: FormDesignModel
Returns the Detail, which is displayed right of the Caption

Specified by:
getDetail in interface FormDesignModel
Returns:
String
See Also:
FormDesignModel.getDetail()

setDetail

public void setDetail(java.lang.String detail)
Description copied from interface: FormDesignModel
Sets the Detail

Specified by:
setDetail in interface FormDesignModel
Parameters:
detail - Detail String
See Also:
FormDesignModel.setDetail(String)

getFormId

public java.lang.String getFormId()
Description copied from interface: FormDesignModel
Returns the form identifier

Specified by:
getFormId in interface FormDesignModel
Returns:
String
See Also:
FormDesignModel.getFormId()

setFormId

public void setFormId(java.lang.String formid)
Description copied from interface: FormDesignModel
Sets the form identifier

Specified by:
setFormId in interface FormDesignModel
Parameters:
formid - Id
See Also:
FormDesignModel.setFormId(String formid)

getFormType

public FormType getFormType()
Description copied from interface: FormDesignModel
Returns the FormType

Specified by:
getFormType in interface FormDesignModel
Returns:
FormType
See Also:
FormDesignModel.getFormType()

setFormType

public void setFormType(FormType type)
Description copied from interface: FormDesignModel
Sets the FormType

Specified by:
setFormType in interface FormDesignModel
Parameters:
type - FormType
See Also:
FormDesignModel.setFormType(com.cc.framework.ui.FormType)

addFormElement

public void addFormElement(FormElement element)
Description copied from interface: FormElementContainer
Adds a new child element to the container

Specified by:
addFormElement in interface FormElementContainer
Parameters:
element - The new form element
See Also:
FormElementContainer.addFormElement(FormElement element)

getFormElement

public FormElement getFormElement(int index)
Description copied from interface: FormElementContainer
Returns a single elements in the container

Specified by:
getFormElement in interface FormElementContainer
Parameters:
index - Elements index
Returns:
FormElement
See Also:
FormElementContainer.getFormElement(int)

getFormElements

public FormElement[] getFormElements()
Description copied from interface: FormElementContainer
Returns a list with all elements in the container

Specified by:
getFormElements in interface FormElementContainer
Returns:
FormElement
See Also:
FormElementContainer.getFormElements()

getFormElements

public FormElement[] getFormElements(Principal principal)
Description copied from interface: FormElementContainer
Returns a list with all visible elements in the container filtered on the principals permissions

Specified by:
getFormElements in interface FormElementContainer
Parameters:
principal - the principal object with the permissions
Returns:
FormElement
See Also:
FormElementContainer.getFormElements(com.cc.framework.security.Principal)

removeFormElement

public void removeFormElement(FormElement element)
Description copied from interface: FormElementContainer
Removes the specified form element from the container

Specified by:
removeFormElement in interface FormElementContainer
Parameters:
element - The form element to remove
See Also:
FormElementContainer.removeFormElement(FormElement)

size

public int size()
Description copied from interface: FormElementContainer
Returns the number of elements in the container

Specified by:
size in interface FormElementContainer
Returns:
integer
See Also:
FormElementContainer.size()

getColSpan

public int getColSpan()
Description copied from interface: FormElement
Returns the column span for this element

Specified by:
getColSpan in interface FormElement
Returns:
column span
See Also:
FormElement.getColSpan()

setColSpan

public void setColSpan(int colspan)
Description copied from interface: FormElement
Sets the column span of this form element

Specified by:
setColSpan in interface FormElement
Parameters:
colspan - column span
See Also:
FormElement.setColSpan(int)

getColumnGroup

public FormColumnGroup getColumnGroup()
Specified by:
getColumnGroup in interface FormElementContainer
Returns:
returns the column group for this element group
See Also:
FormElementContainer.getColumnGroup()

getOrientation

public OrientationType getOrientation()
Specified by:
getOrientation in interface FormElementContainer
Returns:
the orientation of the child elements
See Also:
FormElementContainer.getOrientation()

joinElements

public boolean joinElements()
Description copied from interface: FormElement
This method returns true when two adjacent form elements should be joined together without a separator

Specified by:
joinElements in interface FormElement
Returns:
true when the form elements should be joined
See Also:
FormElement.joinElements()

setJoin

public void setJoin(boolean join)
Description copied from interface: FormElement
This method specifies that two adjacent form elements should be joined together without a separator

Specified by:
setJoin in interface FormElement
Parameters:
join - true when the form elements should be joined
See Also:
FormElement.setJoin(boolean)

getImageMap

public ImageMap getImageMap()
Description copied from interface: FormDesignModel
Returns the ImageMap

Specified by:
getImageMap in interface FormDesignModel
Returns:
ImageMap
See Also:
FormDesignModel.getImageMap()

setImageMap

public void setImageMap(ImageMap imagemap)
Description copied from interface: FormDesignModel
Sets the ImageMap

Specified by:
setImageMap in interface FormDesignModel
Parameters:
imagemap - ImageMap
See Also:
FormDesignModel.setImageMap(com.cc.framework.ui.ImageMap)

setShowFrame

public void setShowFrame(boolean show)
Description copied from interface: FormElementContainer
Disables the forms border

Specified by:
setShowFrame in interface FormElementContainer
Parameters:
show - true if the forms frame should be shown
See Also:
FormElementContainer.setShowFrame(boolean)

showFrame

public boolean showFrame()
Specified by:
showFrame in interface FormElementContainer
Returns:
true if the frame should be shown
See Also:
FormElementContainer.showFrame()

getAlignment

public AlignmentType getAlignment()
Description copied from interface: FormElement
Returns the horizontal alignment

Specified by:
getAlignment in interface FormElement
Returns:
alignment
See Also:
FormElement.getAlignment()

getVAlignment

public AlignmentType getVAlignment()
Description copied from interface: FormElement
Returns the vertical alignment

Specified by:
getVAlignment in interface FormElement
Returns:
alignment
See Also:
FormElement.getVAlignment()

setAlignment

public void setAlignment(AlignmentType alignment)
Description copied from interface: FormElement
Specifies the horizontal alignment of the form element within the form

Specified by:
setAlignment in interface FormElement
Parameters:
alignment - The alignment of the element
See Also:
FormElement.setAlignment(com.cc.framework.ui.AlignmentType)

setVAlignment

public void setVAlignment(AlignmentType valignment)
Description copied from interface: FormElement
Specifies the vertical alignment of the form element within the form

Specified by:
setVAlignment in interface FormElement
Parameters:
valignment - The alignment of the element
See Also:
FormElement.setVAlignment(com.cc.framework.ui.AlignmentType)

getNoWrap

public boolean getNoWrap()
Description copied from interface: FormElement
Indicates that the form element cell should not be wrapped

Specified by:
getNoWrap in interface FormElement
Returns:
Boolean
See Also:
FormElement.getNoWrap()

getImage

public ImageModel getImage()
Description copied from interface: FrameContainer
Returns the image for the frames title

Specified by:
getImage in interface FrameContainer
Returns:
ImageModel
See Also:
FrameContainer.getImage()

setImage

public void setImage(ImageModel img)
Description copied from interface: FrameContainer
Sets an image for the frames title

Specified by:
setImage in interface FrameContainer
Parameters:
img - ImageModel
See Also:
FrameContainer.setImage(com.cc.framework.ui.model.ImageModel)

addInnerFrame

public void addInnerFrame(InnerFrame frame)
Description copied from interface: FrameContainer
Adds a inner frame to the List

Specified by:
addInnerFrame in interface FrameContainer
Parameters:
frame - the inner frame to add
See Also:
FrameContainer.addInnerFrame(com.cc.framework.ui.model.InnerFrame)

getInnerFrames

public InnerFrame[] getInnerFrames(Principal principal,
                                   java.lang.Object layoutHint)
Description copied from interface: FrameContainer
Retrieves a list of only the inner frames that are matching the given layout hint

Specified by:
getInnerFrames in interface FrameContainer
Parameters:
principal - The principal object for permission tests. This parameter can be null
layoutHint - The layout hint that specifies what frames should be selected: AlignmentType.TOP - header frames AlignmentType.BOTTOM - footer frames
Returns:
Frame list
See Also:
FrameContainer.getInnerFrames(com.cc.framework.security.Principal, java.lang.Object)

getButtonPermission

public Permission getButtonPermission(ControlButton button)
Description copied from interface: ButtonContainer
Retrieves the permission for the given button

Specified by:
getButtonPermission in interface ButtonContainer
Parameters:
button - Button constant
Returns:
Permission or null
See Also:
ButtonContainer.getButtonPermission(com.cc.framework.ui.control.ControlButton)

showButton

public boolean showButton(ControlButton button,
                          Principal principal)
Description copied from interface: ButtonContainer
Checks if the button can be displayed.

Specified by:
showButton in interface ButtonContainer
Parameters:
button - The Button to query
principal - The principal object
Returns:
boolean true if the button should be displayed
See Also:
ButtonContainer.showButton(com.cc.framework.ui.control.ControlButton, com.cc.framework.security.Principal)

setButtonPermission

public void setButtonPermission(ControlButton button,
                                Permission permission)
Description copied from interface: ButtonContainer
Sets whether a command button should be displayed by specifying an Access Control List.

Specified by:
setButtonPermission in interface ButtonContainer
Parameters:
button - The Button to query
permission - Permission
See Also:
ButtonContainer.setButtonPermission(com.cc.framework.ui.control.ControlButton, com.cc.framework.security.Permission)

getLabelPrefix

public java.lang.String getLabelPrefix()
Description copied from interface: FormDesignModel
Retrieves the optional label prefix in plain HTML. This attribute can be overwritten at form element level.

Specified by:
getLabelPrefix in interface FormDesignModel
Returns:
Prefix (plain HTML) or null
See Also:
FormDesignModel.getLabelPrefix()

getLabelSuffix

public java.lang.String getLabelSuffix()
Description copied from interface: FormDesignModel
Retrieves the optional label suffix in plain HTML. This attribute can be overwritten at form element level.

Specified by:
getLabelSuffix in interface FormDesignModel
Returns:
Suffix (plain HTML) or null
See Also:
FormDesignModel.getLabelSuffix()

setLabelPrefix

public void setLabelPrefix(java.lang.String prefix)
Description copied from interface: FormDesignModel
Specifies the label prefix in plain HTML. This attribute can be overwritten at form element level.

Specified by:
setLabelPrefix in interface FormDesignModel
Parameters:
prefix - The label prefix
See Also:
FormDesignModel.setLabelPrefix(java.lang.String)

setLabelSuffix

public void setLabelSuffix(java.lang.String suffix)
Description copied from interface: FormDesignModel
Specifies the label suffix in plain HTML. This attribute can be overwritten at form element level.

Specified by:
setLabelSuffix in interface FormDesignModel
Parameters:
suffix - The label suffix
See Also:
FormDesignModel.setLabelSuffix(java.lang.String)

getExpandProperty

public java.lang.String getExpandProperty()
Description copied from interface: FormElementContainer
Retrieves the name of a property that is used to expand or collapse the group

Specified by:
getExpandProperty in interface FormElementContainer
Returns:
propertyName
See Also:
FormElementContainer.getExpandProperty()

setExpandProperty

public void setExpandProperty(java.lang.String propertyName)
Description copied from interface: FormElementContainer
Sets the name of a property that is used to expand or collapse the group

Specified by:
setExpandProperty in interface FormElementContainer
Parameters:
propertyName - java property name
See Also:
FormElementContainer.setExpandProperty(java.lang.String)

setLabelWidth

public void setLabelWidth(java.lang.String width)
Description copied from interface: FormElementContainer
Sets the width of the labels for this container.

Specified by:
setLabelWidth in interface FormElementContainer
Parameters:
width - label width or null for default label width
See Also:
FormElementContainer.setLabelWidth(java.lang.String)

getLabelWidth

public java.lang.String getLabelWidth()
Description copied from interface: FormElementContainer
Returns the width of the labels for this container.

Specified by:
getLabelWidth in interface FormElementContainer
Returns:
label width or null for default label width
See Also:
FormElementContainer.getLabelWidth()

getCellWidth

public java.lang.String getCellWidth()
Description copied from interface: FormElementContainer
Returns the width of the control cell for this container.

Specified by:
getCellWidth in interface FormElementContainer
Returns:
control cell width or null
See Also:
FormElementContainer.getCellWidth()

setCellWidth

public void setCellWidth(java.lang.String width)
Description copied from interface: FormElementContainer
Sets the width of the control cell for this container.

Specified by:
setCellWidth in interface FormElementContainer
Parameters:
width - control cell width or null
See Also:
FormElementContainer.setCellWidth(java.lang.String)


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