|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.ui.painter.ControlPainter com.cc.framework.ui.painter.def.DefPainterBase com.cc.framework.ui.painter.def.DefFormPainter
Base class for form painters
Field Summary | |
protected static FormLabelDesignModel |
LABEL_EMPTY
Empty Label |
protected static FormLabelDesignModel |
LABEL_MESSAGE
Message Label |
protected static java.lang.String |
ROWTYPE
Custom HTML attribute to identify row types |
protected static java.lang.String |
ROWTYPE_BUTTONS
Row Type: Button Container |
protected static java.lang.String |
ROWTYPE_CONTAINER
Row Type: Container |
protected static java.lang.String |
ROWTYPE_CONTROL
Row Type: Control |
protected static java.lang.String |
ROWTYPE_DESCRIPTION
Row Type: Description |
protected static java.lang.String |
ROWTYPE_INNERFRAME
Row Type: Inner Frame |
protected static java.lang.String |
ROWTYPE_SEPARATOR
Row Type: Separator |
Fields inherited from class com.cc.framework.ui.painter.ControlPainter |
log |
Constructor Summary | |
DefFormPainter(PainterContext painterContext,
FormControl ctrl)
Constructor for DefFormPainter |
Method Summary | |
protected void |
addColGroup(org.apache.ecs.html.Table table,
FormElementContainer container)
|
protected boolean |
attachRight(FormElement formElement)
This method will check if the required image should be attached left or right to the description This is required for some Controls like the RadioControl or CheckboxControl. |
protected org.apache.ecs.ConcreteElement |
createButtons(FormButtonContainer container)
Creates the buttons of a button container |
private org.apache.ecs.html.Col |
createCol(java.lang.String width)
|
protected org.apache.ecs.ConcreteElement |
createElementBody(FormElement formElement,
java.util.Collection decorations)
This method creates the Body content of a form element |
protected java.lang.String |
decorateLabel(java.lang.String text,
FormLabelDesignModel label)
Adds the prefix and the suffix to the label |
protected void |
doAfterCreate()
This template method gets called after element creation |
protected void |
doBeforeCreate()
This template method gets called before element creation |
protected org.apache.ecs.ConcreteElement |
doCreateBody()
Creates the from body. |
protected org.apache.ecs.ConcreteElement |
doCreateButton(FormButtonElement formButton)
This method creates the button for a form element of type FormButtonElement |
protected org.apache.ecs.ConcreteElement |
doCreateColGroup(FormElementContainer container)
Creates the HTML <COLGROUP> Element for the list |
protected org.apache.ecs.ConcreteElement |
doCreateContainer(FormElementContainer container,
int cols,
int nestingLevel)
This method creates a generic container |
protected org.apache.ecs.ConcreteElement |
doCreateControl(FormControlElement formElement,
java.util.Collection decorations)
This method creates the control for a form element of type FormControlElement |
protected org.apache.ecs.ConcreteElement |
doCreateDefaultButton()
This method creates a hidden default button for the form |
protected org.apache.ecs.ConcreteElement |
doCreateDefaultButton(FormButtonElement button)
This method creates a hidden default button for the form |
protected org.apache.ecs.ConcreteElement |
doCreateElement()
Creates the HTML Code for the following Elements: Title Body Footer (optional) |
protected org.apache.ecs.ConcreteElement |
doCreateFooter()
Creates an additional footer. |
protected org.apache.ecs.ConcreteElement |
doCreateFrames(AlignmentType alignmentFilter)
Creates a frame container with all frames that match the given filter |
protected org.apache.ecs.ConcreteElement |
doCreateGroupHeader(FormGroupElement group,
int cols,
int nestingLevel)
Creates the header row for a form element group |
protected org.apache.ecs.ConcreteElement |
doCreateHeader()
Creates an additional header. |
protected org.apache.ecs.ConcreteElement |
doCreateHorizontalContainer(FormElementContainer container,
int cols,
int nestingLevel)
This method creates a container with horizontal orientation |
protected org.apache.ecs.ConcreteElement |
doCreateHtml(FormHtmlElement formElement)
This method creates a form element of type FormHtmlElement |
protected org.apache.ecs.ElementContainer |
doCreateInnerFrames(InnerFrame[] innerFrames,
int cols,
int nestingLevel)
This method creates inner frames |
protected org.apache.ecs.ConcreteElement |
doCreateLabeledElement(FormElement formElement,
int cols)
This method creates the TD's for a labeled form element |
protected org.apache.ecs.ConcreteElement |
doCreateRow(org.apache.ecs.ConcreteElement rowContent,
int nestingLevel,
java.lang.String rowType)
This method creates a row container |
protected org.apache.ecs.ConcreteElement |
doCreateRow(FormElementContainer container,
org.apache.ecs.ConcreteElement rowContent,
int nestingLevel,
java.lang.String rowType)
This method creates a row container |
protected org.apache.ecs.ConcreteElement |
doCreateRowSeparator(int cols,
int nestingLevel)
This method creates a row separator |
protected java.util.Collection |
doCreateTitleButtons()
Creates the buttons in the header of the list |
protected org.apache.ecs.ConcreteElement |
doCreateVerticalContainer(FormElementContainer container,
int cols,
int nestingLevel)
This method creates a container with vertical orientation |
protected int |
getCellsPerElement()
Returns the required number of TD-Elements for one form element |
protected java.lang.String |
getCellWidth(FormElementContainer container,
int columnIndex)
Returns the width of the control cell for the given element container |
protected FormButtonElement |
getDefaultButton(FormElementContainer container)
Searches the FormElement tree for a default button |
protected java.lang.String |
getDescription(FormElement formElement)
Retrieves the description of a form element |
java.lang.String |
getElementClass(int type)
The method returns the HTML style class required for a list or treelist control. |
FormControl |
getForm()
Returns the from control |
protected java.lang.String |
getFormElementId(FormElement formElement)
Returns a id for the element that can be used in java script |
protected ImageModel |
getFormImage(java.lang.String imageref)
Returns the referenced Image |
FormType |
getFormType()
Returns the type of the form |
protected FrameTitle |
getFrameTitle()
Creates the Title for the Frame |
protected java.lang.String |
getFrameWidth(FormElementContainer container)
Returns the with of the frame surrounding the form |
protected FormLabelDesignModel |
getLabel(FormElement formElement)
Retrieves the label of a form element |
protected java.lang.String |
getLabelWidth(FormElementContainer container,
int columnIndex)
Returns the width of the label column for the given element container |
protected java.lang.String |
getLinkId(FormElement formElement)
Retrieves the Control Style id of the control element |
protected java.util.Locale |
getLocale(FormLabelDesignModel label)
Retrieves the locale to use for a given label |
protected java.lang.String |
getMessageWidth(FormElementContainer container)
Returns the width of the message indicator (for editable forms only) |
protected boolean |
hasErrorPending(FormElement formElement)
Checks if a error hint must be painted |
protected boolean |
hasMessagePending(FormElement formElement)
Checks if a message hint must be painted |
protected boolean |
isRequired(FormElement formElement)
Checks if a form element is a required input field |
protected void |
paintLabel(org.apache.ecs.html.TD labelCell,
FormLabelDesignModel label,
java.lang.String linkId)
Paints the Label of a form element |
protected void |
paintMessageIndicatior(org.apache.ecs.html.TD msgCell,
FormElement formElement)
Deprecated. use paintMessageIndicator method instead |
protected void |
paintMessageIndicator(org.apache.ecs.html.TD msgCell,
FormElement formElement)
paints the message indicator |
protected boolean |
showFrame()
Checks if the frame should be painted |
protected boolean |
showMessageIndicator()
|
Methods inherited from class com.cc.framework.ui.painter.def.DefPainterBase |
createHelpElement, createHelpElement, doCreateHelpButton, doCreateHelpIcon |
Methods inherited from class com.cc.framework.ui.painter.ControlPainter |
ajaxPaint, attr, attr, attr, beginPaint, createActionPainter, createActionPainter, createElement, createImage, createImage, createImage, createInput, createInput, createSpacer, createSpacer, createSpacer, decorateURL, doAddDecorationsToRow, doAddDecorationsToRow, doAttachDecorations, encodeURL, endPaint, forceControlName, getAsString, getAwtColor, getColor, getContextPath, getControlName, getDecorationsOnce, getElementName, getFramePainter, getFrameworkString, getFrameworkString, getImage, getImage, getImage, getImageSrc, getImageSrc, getImageSrc, getLocale, getPageContext, getPainterContext, getPrincipal, getRequest, getResponse, getSession, getSmartCaption, getSmartDetail, getSource, getSource, getStringResource, getStyleId, html, html, html, init, isRunAtClient, localize, localize, localize, paint, removeHtml, removeHtml, request, response, session, showComments |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String ROWTYPE
protected static final java.lang.String ROWTYPE_DESCRIPTION
protected static final java.lang.String ROWTYPE_SEPARATOR
protected static final java.lang.String ROWTYPE_CONTAINER
protected static final java.lang.String ROWTYPE_BUTTONS
protected static final java.lang.String ROWTYPE_CONTROL
protected static final java.lang.String ROWTYPE_INNERFRAME
protected static final FormLabelDesignModel LABEL_EMPTY
protected static final FormLabelDesignModel LABEL_MESSAGE
Constructor Detail |
public DefFormPainter(PainterContext painterContext, FormControl ctrl)
painterContext
- The PainterContextctrl
- The Control to renderMethod Detail |
public FormControl getForm()
public FormType getFormType()
protected boolean showFrame()
true
if the frame should be paintedprotected java.lang.String getFrameWidth(FormElementContainer container)
container
- the form element container
null
is returned no frame will be shownprotected java.lang.String getMessageWidth(FormElementContainer container)
container
- the form element container
protected java.lang.String getLabelWidth(FormElementContainer container, int columnIndex)
container
- the form element containercolumnIndex
- the index of the form column within the container
protected java.lang.String getCellWidth(FormElementContainer container, int columnIndex)
container
- the form element containercolumnIndex
- the index of the form column within the container
public java.lang.String getElementClass(int type)
ControlPainter
getElementClass
in class DefPainterBase
ControlPainter.getElementClass(int)
protected boolean showMessageIndicator()
true
when the form should reserve space
for the message indicator filedprotected int getCellsPerElement()
protected ImageModel getFormImage(java.lang.String imageref)
imageref
- the image reference
null
protected org.apache.ecs.ConcreteElement doCreateRow(org.apache.ecs.ConcreteElement rowContent, int nestingLevel, java.lang.String rowType)
rowContent
- TD Element(s) with the rows contentnestingLevel
- The nesting Level of the row in the form element treerowType
- an additional attribute for this row. This enables a
JavaScript client to identify the row
protected org.apache.ecs.ConcreteElement doCreateRow(FormElementContainer container, org.apache.ecs.ConcreteElement rowContent, int nestingLevel, java.lang.String rowType)
container
- The form element for this new rowrowContent
- TD Element(s) with the rows contentnestingLevel
- The nesting Level of the row in the form element treerowType
- an additional attribute for this row. This enables a
JavaScript client to identify the row
protected java.util.Locale getLocale(FormLabelDesignModel label)
label
- the label
protected java.lang.String decorateLabel(java.lang.String text, FormLabelDesignModel label)
text
- The label textlabel
- The Label Definition
protected void paintLabel(org.apache.ecs.html.TD labelCell, FormLabelDesignModel label, java.lang.String linkId)
labelCell
- The cell where to put the labellabel
- The Design Model of the labellinkId
- The id of the control to link this label toprotected java.lang.String getLinkId(FormElement formElement)
formElement
- The form element
null
protected void paintMessageIndicator(org.apache.ecs.html.TD msgCell, FormElement formElement)
msgCell
- The cell where to put the indicatorformElement
- The form elementprotected void paintMessageIndicatior(org.apache.ecs.html.TD msgCell, FormElement formElement)
msgCell
- The cell where to put the indicatorformElement
- The form elementprotected org.apache.ecs.ConcreteElement doCreateLabeledElement(FormElement formElement, int cols)
formElement
- the form elementcols
- number of form element columns to span
protected boolean attachRight(FormElement formElement)
formElement
- The FormElement
protected FormLabelDesignModel getLabel(FormElement formElement)
formElement
- Form element
null
protected java.lang.String getDescription(FormElement formElement)
formElement
- Form element
null
protected org.apache.ecs.ConcreteElement createElementBody(FormElement formElement, java.util.Collection decorations)
formElement
- the form elementdecorations
- Additional decoration elements that should be rendered next to
the elements body
protected org.apache.ecs.ConcreteElement createButtons(FormButtonContainer container)
container
- Container definition
protected org.apache.ecs.ConcreteElement doCreateRowSeparator(int cols, int nestingLevel)
cols
- number of form element columns to spannestingLevel
- The nesting Level of the row in the form element tree
protected org.apache.ecs.ElementContainer doCreateInnerFrames(InnerFrame[] innerFrames, int cols, int nestingLevel)
innerFrames
- The frame definitionscols
- number of form element columns to spannestingLevel
- The nesting Level of the row in the form element tree
protected org.apache.ecs.ConcreteElement doCreateGroupHeader(FormGroupElement group, int cols, int nestingLevel)
group
- the groupcols
- the number of form element columns to spannestingLevel
- the nesting level of the group within the form element tree
protected org.apache.ecs.ConcreteElement doCreateControl(FormControlElement formElement, java.util.Collection decorations)
FormControlElement
formElement
- from elementdecorations
- Additional decoration elements that should be rendered next to
the elements body
protected org.apache.ecs.ConcreteElement doCreateButton(FormButtonElement formButton)
FormButtonElement
formButton
- the button element
protected org.apache.ecs.ConcreteElement doCreateHtml(FormHtmlElement formElement)
FormHtmlElement
formElement
- from element
protected java.util.Collection doCreateTitleButtons()
protected org.apache.ecs.ConcreteElement doCreateHorizontalContainer(FormElementContainer container, int cols, int nestingLevel)
container
- container elementcols
- the number of form element columns to span.nestingLevel
- the nesting level of the group within the form element tree
protected org.apache.ecs.ConcreteElement doCreateVerticalContainer(FormElementContainer container, int cols, int nestingLevel)
container
- container elementcols
- the number of form element columns to span.nestingLevel
- the nesting level of the group within the form element tree
protected FormButtonElement getDefaultButton(FormElementContainer container)
container
- Node of the FormElement Tree
null
protected org.apache.ecs.ConcreteElement doCreateDefaultButton()
null
protected org.apache.ecs.ConcreteElement doCreateDefaultButton(FormButtonElement button)
button
- the default button
null
protected org.apache.ecs.ConcreteElement doCreateContainer(FormElementContainer container, int cols, int nestingLevel)
container
- container elementcols
- the number of form element columns to span.nestingLevel
- the nesting level of the group within the form element tree
protected org.apache.ecs.ConcreteElement doCreateHeader()
private org.apache.ecs.html.Col createCol(java.lang.String width)
protected org.apache.ecs.ConcreteElement doCreateColGroup(FormElementContainer container)
protected void addColGroup(org.apache.ecs.html.Table table, FormElementContainer container)
protected org.apache.ecs.ConcreteElement doCreateBody()
protected org.apache.ecs.ConcreteElement doCreateFooter()
protected org.apache.ecs.ConcreteElement doCreateFrames(AlignmentType alignmentFilter)
alignmentFilter
- the filter
null
protected FrameTitle getFrameTitle()
null
protected void doBeforeCreate()
ControlPainter
doBeforeCreate
in class ControlPainter
ControlPainter.doBeforeCreate()
protected org.apache.ecs.ConcreteElement doCreateElement()
doCreateElement
in class ControlPainter
protected void doAfterCreate()
ControlPainter
doAfterCreate
in class ControlPainter
ControlPainter.doAfterCreate()
protected java.lang.String getFormElementId(FormElement formElement)
formElement
- form element
null
protected boolean isRequired(FormElement formElement)
formElement
- form element
protected boolean hasErrorPending(FormElement formElement)
formElement
- form element
protected boolean hasMessagePending(FormElement formElement)
formElement
- form element
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |