com.cc.framework.ui.control
Class FormGroupElement

java.lang.Object
  extended bycom.cc.framework.ui.control.FormGroupElement
All Implemented Interfaces:
AccessControlled, FormElement, FormElementContainer
Direct Known Subclasses:
FormButtonContainer

public class FormGroupElement
extends java.lang.Object
implements FormElementContainer

Group of form elements

Version:
$Revision: 1.17 $
Author:
Harald Schulz

Field Summary
private  AlignmentType alignment
          The horizontal alignment of the form element
private  java.lang.String cellWidth
          The width of the cell area for this container
private  int colspan
          The ColumnSpan of this group
private  FormColumnGroup columnGroup
          The column group definition with the column widths
private  java.util.ArrayList elements
          Child form elements
private  java.lang.String expandProperty
          The (optional) name of a property that is used to expand or collapse the group
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 imageRef
          Reference to an image in the ImageMap of the form which should be displayed in front of the label.
private  boolean join
          This flag indicates that this element should be joined with the preceding element without a separator
private  java.lang.String labelWidth
          The width of the label area for this container
private  OrientationType orientation
          The orientation of the elements in this group
private  FormElementContainer parent
          The parent container
private  Permission permission
          permissions for the element
private  boolean showFrame
          Enables or disables the forms frame
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  java.lang.String title
          caption
private  AlignmentType valignment
          The vertical alignment of the form element
private  java.lang.String width
          The width of the form element
 
Constructor Summary
FormGroupElement()
          Constructor
 
Method Summary
 void addFormElement(FormElement element)
          Adds a new child element to the container
 AlignmentType getAlignment()
          Returns the horizontal alignment
 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 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 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 getImageRef()
          Returns the assignment Rule
 java.lang.String getLabelWidth()
          Returns the width of the labels for this container.
 boolean getNoWrap()
          Indicates that the form element cell should not be wrapped
 OrientationType getOrientation()
           
 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
 java.lang.String getTitle()
          Returns the title.
 AlignmentType getVAlignment()
          Returns the vertical alignment
 java.lang.String getWidth()
          Returns the width of the form element (pixel or %)
 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 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 setExpandProperty(java.lang.String propertyName)
          Sets the name of a property that is used to expand or collapse the group
 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 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 setLabelWidth(java.lang.String width)
          Sets the width of the labels for this container.
 void setOrientation(OrientationType type)
           
 void setParent(FormElementContainer parent)
           
 void setPermission(Permission permission)
          Sets the elements permission
 void setShowFrame(boolean show)
          Disables the forms border
 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 setTitle(java.lang.String title)
          Sets the title.
 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.
 boolean showFrame()
           
 int size()
          Returns the number of elements in the container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private FormElementContainer parent
The parent container


title

private java.lang.String title
caption


orientation

private OrientationType orientation
The orientation of the elements in this group


elements

private java.util.ArrayList elements
Child form elements


colspan

private int colspan
The ColumnSpan of this group


join

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


imageRef

private java.lang.String imageRef
Reference to an image in the ImageMap of the form which should be displayed in front of the label.


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


showFrame

private boolean showFrame
Enables or disables the forms frame


expandProperty

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


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


permission

private Permission permission
permissions for the element


columnGroup

private FormColumnGroup columnGroup
The column group definition with the column widths

Constructor Detail

FormGroupElement

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

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(com.cc.framework.ui.control.FormElement)

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

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

getOrientation

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

setOrientation

public void setOrientation(OrientationType type)
Parameters:
type - the orientation of the child elements

getTitle

public java.lang.String getTitle()
Returns the title.

Returns:
String

setTitle

public void setTitle(java.lang.String title)
Sets the title.

Parameters:
title - The title to set

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

getImageRef

public java.lang.String getImageRef()
Returns the assignment Rule

Returns:
String

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)

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

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)

getColumnGroup

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


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