|
|||||||||||
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
This Class is responsible for the HTML-generation (rendering) of a Control
Field Summary | |
private FramePainter |
framePainter
The painter that is used to create the frame element |
protected org.apache.commons.logging.Log |
log
Commons Logging instance. |
private PainterContext |
painterContext
PageContext of the JSP page |
Constructor Summary | |
ControlPainter()
Constructor for ControlPainter |
|
ControlPainter(PainterContext painterContext)
Constructor for ControlPainter |
Method Summary | |
void |
ajaxPaint(java.io.Writer out)
Writes an AJAX XML Stream for the control |
java.lang.String |
attr(java.lang.Object raw)
Converts a String to a valid HTML Attribute |
java.lang.String |
attr(java.lang.Object raw,
boolean filter)
Converts a String to a valid HTML Attribute |
java.lang.String |
attr(java.lang.Object raw,
boolean filter,
int maxlength)
Converts a String to a valid HTML Attribute |
void |
beginPaint(java.io.Writer out)
Method beginPaint |
ActionPainter |
createActionPainter(ControlActionDef action)
Creates an ActionPainter. |
ActionPainter |
createActionPainter(ControlActionDef action,
java.lang.String actionName)
Creates an ActionPainter. |
org.apache.ecs.ConcreteElement |
createElement()
Creates the HTML-Element. |
org.apache.ecs.html.IMG |
createImage(ImageModel image)
Creates an HTML image Tag for the specified image model |
org.apache.ecs.html.IMG |
createImage(java.lang.String resourceId)
Retrieves an image for the specified Id |
org.apache.ecs.html.IMG |
createImage(java.lang.String resourceId,
java.lang.Object param)
Retrieves an image for the specified Id |
org.apache.ecs.html.Input |
createInput(ImageModel image)
Retrieves an image for the specified Id |
org.apache.ecs.html.Input |
createInput(java.lang.String resourceId)
Retrieves an image for the specified Id |
org.apache.ecs.ConcreteElement |
createSpacer(int height,
int width)
Creates a spacer image with the given dimension |
org.apache.ecs.ConcreteElement |
createSpacer(int height,
java.lang.String width)
Creates a spacer image with the given dimension |
org.apache.ecs.ConcreteElement |
createSpacer(java.lang.String height,
java.lang.String width)
Creates a spacer image with the given dimension |
java.lang.String |
decorateURL(java.lang.String url)
Decorates the URL with RequestDecorator settings and appends the JSESSIONID when URL-rewriting is enabled to track sessions Every URL has to be decorated this way! |
protected void |
doAddDecorationsToRow(org.apache.ecs.html.TR row,
int rowSpan)
Attaches all decoration elements that are stored in the painter context to the control HTML table row. |
protected void |
doAddDecorationsToRow(org.apache.ecs.html.TR row,
int rowSpan,
java.util.Collection decorations)
Attaches all decoration elements that are stored in the painter context to the control HTML table row. |
protected void |
doAfterCreate()
This template method gets called after element creation |
protected org.apache.ecs.ConcreteElement |
doAttachDecorations(org.apache.ecs.ConcreteElement control)
Attaches all decoration elements that are stored in the painter context to the left side of the control. |
protected void |
doBeforeCreate()
This template method gets called before element creation |
protected abstract org.apache.ecs.ConcreteElement |
doCreateElement()
Creates the HTML-Element. |
java.lang.String |
encodeURL(java.lang.String src)
Encodes an URL Some characters present the possibility of being misunderstood within URLs for various reasons. |
void |
endPaint(java.io.Writer out)
This Method writes the Control as an HTML-String to the Output from the JSP-Page. |
java.lang.String |
forceControlName()
|
java.lang.String |
getAsString(Converter converter,
java.lang.Object value)
Uses a Bean Converter to convert the given object to a String representation. |
java.awt.Color |
getAwtColor(java.lang.String resourceId)
Retrieves an color for the specified Id |
Color |
getColor(java.lang.String resourceId)
Retrieves an color for the specified Id |
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context of the request |
java.lang.String |
getControlName()
|
protected java.util.Collection |
getDecorationsOnce()
Removes the decoration collection from the Painter Context this method can only be called once. subsequent calls will return a null pointer! |
java.lang.String |
getElementClass(int type)
The method returns the HTML style class required for a list or treelist control. |
java.lang.String |
getElementName()
Retrieves the name of the HTML element. |
protected FramePainter |
getFramePainter()
Returns the FramePainter for this Control. |
java.lang.String |
getFrameworkString(java.lang.String resourceId)
Retrieves an framework String for the specified Id |
java.lang.String |
getFrameworkString(java.lang.String resourceId,
java.lang.Object[] arguments)
Retrieves an framework String for the specified Id |
ImageModel |
getImage(int size,
java.lang.String resourceId)
Retrieves an image for the specified Id |
ImageModel |
getImage(java.lang.String resourceId)
Retrieves an image for the specified Id |
ImageModel |
getImage(java.lang.String resourceId,
java.lang.Object param)
Retrieves an image for the specified Id |
java.lang.String |
getImageSrc(int size,
java.lang.String resourceId)
Retrieves an image for the specified Id |
java.lang.String |
getImageSrc(java.lang.String resourceId)
Retrieves an image for the specified Id |
java.lang.String |
getImageSrc(java.lang.String resourceId,
java.lang.Object param)
Retrieves an image for the specified Id |
java.util.Locale |
getLocale()
Retrieves the current Locale |
javax.servlet.jsp.PageContext |
getPageContext()
Returns the JSP page context |
PainterContext |
getPainterContext()
Gets the Painter Context |
Principal |
getPrincipal()
Returns the Principal Object |
javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated. use session() |
javax.servlet.http.HttpServletResponse |
getResponse()
Deprecated. use response() |
javax.servlet.http.HttpSession |
getSession()
Deprecated. use session() |
java.lang.String |
getSmartCaption(java.lang.String caption,
java.lang.String detail)
Method getSmartCaption |
java.lang.String |
getSmartDetail(java.lang.String caption,
java.lang.String detail)
Method getSmartDetail |
java.lang.String |
getSource(ImageModel image)
Gets the localized resource name |
java.lang.String |
getSource(java.lang.String base,
java.lang.String src)
Gets the localized Image resource name |
java.lang.String |
getStringResource(java.lang.String resourceId)
Retrieves an String for the specified Id |
java.lang.String |
getStyleId()
Returns the Style Id of the control. |
java.lang.String |
html(java.lang.Object raw)
Converts a String to an equivalent HTML-String |
java.lang.String |
html(java.lang.Object raw,
boolean filter)
Converts a String to an equivalent HTML-String |
java.lang.String |
html(java.lang.Object raw,
boolean filter,
int maxlength)
Converts a String to an equivalent HTML-String |
void |
init(PainterContext painterContext)
Sets the painter context |
boolean |
isRunAtClient()
This Method checks if the control should run on the client |
java.lang.String |
localize(java.lang.String raw)
Localizes a string depending on the localization settings of the Painter context |
java.lang.String |
localize(java.lang.String raw,
java.util.Locale locale)
Localizes a string depending on the localization settings of the Painter context |
java.lang.String |
localize(java.lang.String raw,
java.lang.Object[] arguments)
Localizes a string depending on the localization settings of the Painter context |
void |
paint(java.io.Writer out)
Method paint |
protected java.lang.String |
removeHtml(java.lang.Object html)
Removes all HTML formatting from the given HTML-String |
protected java.lang.String |
removeHtml(java.lang.Object html,
boolean filter)
Removes all HTML formatting from the given HTML-String depending on the filter setting |
javax.servlet.http.HttpServletRequest |
request()
Returns the HTTP Request |
javax.servlet.http.HttpServletResponse |
response()
Returns the HTTP Response |
javax.servlet.http.HttpSession |
session()
Gets the session object |
boolean |
showComments()
This method checks if HTML comments should be written to the output |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.commons.logging.Log log
private PainterContext painterContext
private FramePainter framePainter
Constructor Detail |
public ControlPainter()
public ControlPainter(PainterContext painterContext)
painterContext
- The PainterContextMethod Detail |
public void init(PainterContext painterContext)
painterContext
- The PainterContextprotected FramePainter getFramePainter()
public javax.servlet.jsp.PageContext getPageContext()
public Principal getPrincipal()
public java.lang.String getContextPath()
public boolean showComments()
false
when comments should be hiddenpublic javax.servlet.http.HttpServletRequest request()
public javax.servlet.http.HttpServletResponse response()
public javax.servlet.http.HttpSession session()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public javax.servlet.http.HttpSession getSession()
null
public java.util.Locale getLocale()
public boolean isRunAtClient()
true
when the component should run on the
clientpublic java.lang.String getAsString(Converter converter, java.lang.Object value) throws ConverterException
converter
- The converter to use or null
to use a default
Convertervalue
- The Bean to convert
null
ConverterException
- Is thrown when a conversion exception occurspublic java.lang.String decorateURL(java.lang.String url)
url
- the URL to encode
public java.lang.String getStyleId()
public java.lang.String getElementClass(int type)
type
- The required style class
protected abstract org.apache.ecs.ConcreteElement doCreateElement()
protected java.util.Collection getDecorationsOnce()
this method can only be called once. subsequent calls will return
a null
pointer!
protected void doAddDecorationsToRow(org.apache.ecs.html.TR row, int rowSpan)
row
- The row where the decorations should be attachedrowSpan
- the rows that a decoration element should spanprotected void doAddDecorationsToRow(org.apache.ecs.html.TR row, int rowSpan, java.util.Collection decorations)
row
- The row where the decorations should be attachedrowSpan
- the rows that a decoration element should spandecorations
- list with decorationsprotected org.apache.ecs.ConcreteElement doAttachDecorations(org.apache.ecs.ConcreteElement control)
control
- The Controls HTML representation
public java.lang.String encodeURL(java.lang.String src)
src
- The URL which should be encoded
public java.lang.String getSmartCaption(java.lang.String caption, java.lang.String detail)
caption
- Captiondetail
- Detail
public java.lang.String getSmartDetail(java.lang.String caption, java.lang.String detail)
caption
- Captiondetail
- Detail
public java.lang.String getElementName()
protected java.lang.String removeHtml(java.lang.Object html)
html
- Object in HTML format
protected java.lang.String removeHtml(java.lang.Object html, boolean filter)
html
- Object in HTML formatfilter
- Filter
public java.lang.String html(java.lang.Object raw)
raw
- Object
public java.lang.String html(java.lang.Object raw, boolean filter)
raw
- Objectfilter
- Filter
public java.lang.String html(java.lang.Object raw, boolean filter, int maxlength)
raw
- Objectfilter
- Filtermaxlength
- The maximum number of visible characters
public java.lang.String attr(java.lang.Object raw)
raw
- Object
public java.lang.String attr(java.lang.Object raw, boolean filter)
raw
- Objectfilter
- Filter
public java.lang.String attr(java.lang.Object raw, boolean filter, int maxlength)
raw
- Objectfilter
- Filtermaxlength
- The maximum number of visible characters
public PainterContext getPainterContext()
public java.lang.String localize(java.lang.String raw)
raw
- String
public java.lang.String localize(java.lang.String raw, java.util.Locale locale)
raw
- Stringlocale
- the Locale
public java.lang.String localize(java.lang.String raw, java.lang.Object[] arguments)
raw
- Stringarguments
- MessageFormat arguments
public java.lang.String getSource(java.lang.String base, java.lang.String src)
base
- Base Directory or resource keysrc
- resource name
public java.lang.String getSource(ImageModel image)
image
- Image Model
public Color getColor(java.lang.String resourceId)
resourceId
- Color Code
null
public java.awt.Color getAwtColor(java.lang.String resourceId)
resourceId
- Color Code
null
public ImageModel getImage(java.lang.String resourceId)
resourceId
- Image Code
null
public ImageModel getImage(java.lang.String resourceId, java.lang.Object param)
resourceId
- Image Codeparam
- markup Parameter
public ImageModel getImage(int size, java.lang.String resourceId)
size
- The image sizeresourceId
- Image Code
public java.lang.String getStringResource(java.lang.String resourceId)
resourceId
- The resource id
public java.lang.String getFrameworkString(java.lang.String resourceId)
resourceId
- The resource id
public java.lang.String getFrameworkString(java.lang.String resourceId, java.lang.Object[] arguments)
resourceId
- The resource idarguments
- MessageFormat arguments
public java.lang.String getImageSrc(java.lang.String resourceId)
resourceId
- Image Code
public java.lang.String getImageSrc(java.lang.String resourceId, java.lang.Object param)
resourceId
- Image Codeparam
- markup Parameter
public java.lang.String getImageSrc(int size, java.lang.String resourceId)
size
- Image sizeresourceId
- Image Code
public org.apache.ecs.html.Input createInput(ImageModel image)
image
- Image
null
public org.apache.ecs.html.Input createInput(java.lang.String resourceId)
resourceId
- Image Code
null
public org.apache.ecs.ConcreteElement createSpacer(int height, int width)
height
- spacer heightwidth
- spacer width
public org.apache.ecs.ConcreteElement createSpacer(int height, java.lang.String width)
height
- spacer heightwidth
- spacer width
public org.apache.ecs.ConcreteElement createSpacer(java.lang.String height, java.lang.String width)
height
- spacer heightwidth
- spacer width
public org.apache.ecs.html.IMG createImage(ImageModel image)
image
- Image
null
public org.apache.ecs.html.IMG createImage(java.lang.String resourceId)
resourceId
- Image Code
null
public org.apache.ecs.html.IMG createImage(java.lang.String resourceId, java.lang.Object param)
resourceId
- Image Codeparam
- markup parameter
null
public ActionPainter createActionPainter(ControlActionDef action)
action
- ControlAction
public ActionPainter createActionPainter(ControlActionDef action, java.lang.String actionName)
action
- ControlActionactionName
- Additional Action Name
public java.lang.String getControlName()
null
when the control was not specified with a
"name" and/or "property" attributepublic java.lang.String forceControlName()
protected void doBeforeCreate()
protected void doAfterCreate()
public final org.apache.ecs.ConcreteElement createElement()
null
public final void paint(java.io.Writer out) throws java.io.IOException
out
- JspWriter
java.io.IOException
- If an input or output exception occurredpublic void ajaxPaint(java.io.Writer out) throws java.io.IOException
out
- JspWriter
java.io.IOException
- If an input or output exception occurredpublic final void beginPaint(java.io.Writer out) throws java.io.IOException
out
- Writer
java.io.IOException
- If an input or output exception occurredpublic final void endPaint(java.io.Writer out) throws java.io.IOException
out
- The Writer
java.io.IOException
- Signals that an I/O exception of some sort has occurred
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |