com.cc.framework.ui.control
Class FormHtmlElement

java.lang.Object
  extended bycom.cc.framework.ui.control.FormHtmlElement
All Implemented Interfaces:
AccessControlled, FormElement, LabeledFormElement

public class FormHtmlElement
extends java.lang.Object
implements LabeledFormElement

A description in a form

Since:
1.0
Version:
$Revision: 1.13 $
Author:
Harald Schulz

Field Summary
private  AlignmentType alignment
          The horizontal alignment of the form element
private  boolean bodyInclude
          Indicates whether the description is set within the body or as an attribute
private  int colspan
          The ColumnSpan of this element
private  boolean filter
          Indicates if the text should be converted into HTML
private  java.lang.String height
          The height of the form element
private  java.lang.String help
          The Help Identifier for this element
private  java.lang.String html
          The description
private  boolean join
          This flag indicates that this element should be joined with the preceding element without a separator
private  FormLabelDesignModel label
          Label of the form element
private  FormElementContainer parent
          The parent container
private  Permission permission
          permissions for this form element
private  boolean required
          Required indicator
private  java.lang.String style
          HTML-Style
private  java.lang.String styleClass
          Style Class -> HTML class attribute
private  java.lang.String styleId
          Style ID
private  AlignmentType valignment
          The vertical alignment of the form element
private  java.lang.String width
          The width of the form element
 
Constructor Summary
FormHtmlElement()
          Constructor
 
Method Summary
 boolean filter()
          Returns the filter.
 AlignmentType getAlignment()
          Returns the horizontal alignment
 int getColSpan()
          Returns the column span for this element
 java.lang.String getDescription()
          Returns the description
 java.lang.String getHeight()
          Returns the height of the form element (pixel or %)
 java.lang.String getHelp()
          Returns the Help id that is associated with this form element.
 java.lang.String getHtml()
          Returns the raw HTML Text
 FormLabelDesignModel getLabel()
          Return the Label which should be display in front of the Form element
 boolean getNoWrap()
          Indicates that the form element cell should not be wrapped
 FormElementContainer getParent()
           
 Permission getPermission()
          Returns the authorizations required to access an object If the method returns null no access rights is required.
 java.lang.String getStyle()
          Returns the Style
 java.lang.String getStyleClass()
          Returns the StyleClass
 java.lang.String getStyleId()
          returns the StyleId
 AlignmentType getVAlignment()
          Returns the vertical alignment
 java.lang.String getWidth()
          Returns the width of the form element (pixel or %)
 boolean isBodyInclude()
          Returns if the description was set within the body (true) or as an attribute (false)
 boolean isRequired()
          True if the form element is required.
 boolean joinElements()
          This method returns true when two adjacent form elements should be joined together without a separator
 void setAccessKey(java.lang.String accessKey)
          The ACCESSKEY attribute can be used to specify a shortcut key for the <LABEL> (activated by pressing 'Alt' and the ACCESSKEY together).
 void setAlignment(AlignmentType alignment)
          Specifies the horizontal alignment of the form element within the form left right center
 void setBodyInclude(boolean include)
          Sets if the description is set within the body (=true)
 void setColSpan(int colspan)
          Sets the column span of this form element
 void setFilter(boolean filter)
          Sets the filter.
 void setHeight(java.lang.String height)
          Sets the height of the form element (pixel or %)
 void setHelp(java.lang.String helpId)
          Associates this form element with a help id
 void setHtml(java.lang.String html)
          Sets the HTML text
 void setImageRef(java.lang.String ref)
          Assigns the Crumb an Image from an ImageMap
 void setJoin(boolean join)
          This method specifies that two adjacent form elements should be joined together without a separator
 void setLabel(FormLabelDesignModel label)
          Sets the elements Label
 void setLabel(java.lang.String label)
          Sets the Label
 void setLabelTooltip(java.lang.String tooltip)
          Sets the tooltip text for the label
 void setParent(FormElementContainer parent)
           
 void setPermission(Permission permission)
          Sets the elements permission
 void setRequired(boolean required)
          Sets the Required Attribute
 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 setVAlignment(AlignmentType valignment)
          Specifies the vertical alignment of the form element within the form top bottom center
 void setWidth(java.lang.String width)
          Sets the width of the form element (pixel or %)
 boolean show(Principal principal)
          Checks if the Object has a required permission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

private FormLabelDesignModel label
Label of the form element


parent

private FormElementContainer parent
The parent container


filter

private boolean filter
Indicates if the text should be converted into HTML


bodyInclude

private boolean bodyInclude
Indicates whether the description is set within the body or as an attribute


html

private java.lang.String html
The description


alignment

private AlignmentType alignment
The horizontal alignment of the form element


valignment

private AlignmentType valignment
The vertical alignment of the form element


height

private java.lang.String height
The height of the form element


width

private java.lang.String width
The width of the form element


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
HTML-Style


help

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


required

private boolean required
Required indicator


permission

private Permission permission
permissions for this form element


colspan

private int colspan
The ColumnSpan of this element


join

private boolean join
This flag indicates that this element should be joined with the preceding element without a separator

Constructor Detail

FormHtmlElement

public FormHtmlElement()
Constructor

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)

getDescription

public java.lang.String getDescription()
Returns the description

Specified by:
getDescription in interface LabeledFormElement
Returns:
String

getHtml

public java.lang.String getHtml()
Returns the raw HTML Text

Returns:
String

setHtml

public void setHtml(java.lang.String html)
Sets the HTML text

Parameters:
html - The HTML Text

filter

public boolean filter()
Returns the filter.

Returns:
boolean

setFilter

public void setFilter(boolean filter)
Sets the filter. If true the description will be HTML encoded (default)

Parameters:
filter - The filter to set

getLabel

public FormLabelDesignModel getLabel()
Return the Label which should be display in front of the Form element

Specified by:
getLabel in interface LabeledFormElement
Returns:
String

setLabel

public void setLabel(java.lang.String label)
Sets the Label

Parameters:
label - Label

setLabel

public void setLabel(FormLabelDesignModel label)
Sets the elements Label

Parameters:
label - Label

setAccessKey

public void setAccessKey(java.lang.String accessKey)
Description copied from interface: LabeledFormElement
The ACCESSKEY attribute can be used to specify a shortcut key for the <LABEL> (activated by pressing 'Alt' and the ACCESSKEY together).

Specified by:
setAccessKey in interface LabeledFormElement
Parameters:
accessKey - The Access Key
See Also:
LabeledFormElement.setAccessKey(java.lang.String)

setLabelTooltip

public void setLabelTooltip(java.lang.String tooltip)
Description copied from interface: LabeledFormElement
Sets the tooltip text for the label

Specified by:
setLabelTooltip in interface LabeledFormElement
Parameters:
tooltip - Tooltip text
See Also:
LabeledFormElement.setLabelTooltip(java.lang.String)

isBodyInclude

public boolean isBodyInclude()
Returns if the description was set within the body (true) or as an attribute (false)

Returns:
true if the body was specified; false otherwise

setBodyInclude

public void setBodyInclude(boolean include)
Sets if the description is set within the body (=true)

Parameters:
include - Flag which indicates if the body was set instead of the attribute

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)
Sets the elements permission

Parameters:
permission - required 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)

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)

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)

setImageRef

public void setImageRef(java.lang.String ref)
Assigns the Crumb an Image from an ImageMap

Parameters:
ref - Rule of the ImageMap to match

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)

getHeight

public java.lang.String getHeight()
Description copied from interface: FormElement
Returns the height of the form element (pixel or %)

Specified by:
getHeight in interface FormElement
Returns:
height
See Also:
FormElement.getHeight()

getWidth

public java.lang.String getWidth()
Description copied from interface: FormElement
Returns the width of the form element (pixel or %)

Specified by:
getWidth in interface FormElement
Returns:
width
See Also:
FormElement.getWidth()

setHeight

public void setHeight(java.lang.String height)
Description copied from interface: FormElement
Sets the height of the form element (pixel or %)

Specified by:
setHeight in interface FormElement
Parameters:
height - The Height
See Also:
FormElement.setHeight(java.lang.String)

setWidth

public void setWidth(java.lang.String width)
Description copied from interface: FormElement
Sets the width of the form element (pixel or %)

Specified by:
setWidth in interface FormElement
Parameters:
width - The Width
See Also:
FormElement.setWidth(java.lang.String)

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

getStyle

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

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

getStyleId

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

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

getStyleClass

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

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

setStyle

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

Specified by:
setStyle in interface FormElement
Parameters:
style - HTML style constant
See Also:
FormElement.setStyle(java.lang.String)

setStyleId

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

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

setStyleClass

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

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

getHelp

public java.lang.String getHelp()
Description copied from interface: FormElement
Returns the Help id that is associated with this form 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 FormElement
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:
FormElement.getHelp()

setHelp

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

Specified by:
setHelp in interface FormElement
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:
FormElement.setHelp(java.lang.String)

isRequired

public boolean isRequired()
True if the form element is required.

Returns:
boolean

setRequired

public void setRequired(boolean required)
Sets the Required Attribute

Parameters:
required - true if the form element is required


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