|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.cc.framework.ui.painter.imp.PainterContextImp
This class encapsulates all the necessary objects for painting the control.
| Field Summary | |
private java.util.Hashtable |
attributes
Attributes |
private java.util.Stack |
attributesSave
Stack for saving the whole Attribute collection |
private Control |
control
Instance of the Control |
private PainterFactory |
factory
The Painter Factory |
private java.util.Locale |
locale
The Locale for this Painter |
private javax.servlet.jsp.PageContext |
pageContext
PageContext of the JSP-Page |
private PainterContext |
parentContext
The nesting Painter Context when the actual control is nested within another control e.g. form elements |
private Principal |
principal
The Principal Object. |
| Constructor Summary | |
PainterContextImp(javax.servlet.jsp.PageContext pageContext,
Control control)
Constructor |
|
| Method Summary | |
java.lang.String |
attr(java.lang.Object raw)
Converts a String to an equivalent HTML-String |
java.lang.String |
attr(java.lang.Object raw,
boolean filter)
Converts a String to an equivalent HTML-String |
java.lang.String |
attr(java.lang.Object raw,
boolean filter,
int maxlength)
Converts a String to an equivalent HTML-String |
void |
close()
After the painter context has been used it has to be closed. |
ActionPainter |
createActionPainter(ControlActionDef action)
Creates an ActionPainter. |
ActionPainter |
createActionPainter(ControlActionDef action,
java.lang.String actionName)
Creates an ActionPainter. |
org.apache.ecs.html.IMG |
createImage(ImageModel image)
Retrieves an image for the specified Id |
org.apache.ecs.html.IMG |
createImage(int size,
java.lang.String resourceId)
Retrieves an image for the specified Id |
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 |
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! |
java.lang.String |
getAsString(Converter converter,
java.lang.Object value)
Uses a Bean Converter to convert the given object to a String representation. |
java.lang.Object |
getAttribute(java.lang.String key,
boolean searchParent)
Gets an Attribute from the Painter Context hierarchy |
java.lang.Object |
getAttribute(java.lang.String name,
HttpScope scope)
Returns the attribute with the given name from the specified scope |
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 |
protected java.util.Stack |
getContextStack()
Retrieves the painter context stack for the current request. |
Control |
getControl()
|
java.lang.String |
getElementName()
Retrieves the name of the HTML element. |
java.lang.String |
getFrameworkString(java.lang.String resourceId)
Returns a framework string resource |
java.lang.String |
getFrameworkString(java.lang.String resourceId,
java.lang.Object[] arguments)
Returns a framework string resource |
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()
Gets the Locale Setting for this Control |
RequestContext |
getNestedContext()
Gets the nested Action Context |
javax.servlet.jsp.PageContext |
getPageContext()
Gets the Page Context |
Principal |
getPrincipal()
Returns the Principal Object in the current User session |
javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated. use request() |
java.lang.String |
getResourceDir()
Returns the base directory used for resource by the painter factory |
javax.servlet.http.HttpServletResponse |
getResponse()
Deprecated. use response() |
javax.servlet.ServletContext |
getServletContext()
Returns the Servlet Context |
javax.servlet.http.HttpSession |
getSession()
Deprecated. use session() |
java.lang.String |
getSource(ImageModel image)
Gets the localized resource name |
java.lang.String |
getSource(java.lang.String base,
java.lang.String src)
Returns the localized Image resource name |
java.lang.String |
getStringResource(java.lang.String stringOrKey)
Returns a string resource |
java.lang.String |
getStyleId()
Returns the Style Id of the control. |
boolean |
hasAttribute(java.lang.String key,
boolean searchParent)
Gets an Attribute from the Painter Context hierarchy |
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 |
protected void |
initLocale()
Sets the locale configuration for this Painter Context. |
boolean |
isDisplayOnly()
This method checks if a control that is rendered within this Painter context has to be "display only" |
boolean |
isRunAtClient()
This Method checks if the control should run on the client |
java.lang.String |
localize(java.lang.String keyOrString)
Localizes a string depending on the localization settings of the Painter context |
java.lang.String |
localize(java.lang.String keyOrString,
java.util.Locale locale)
Localizes a string depending on the localization settings of the Painter context |
java.lang.String |
localize(java.lang.String keyOrString,
java.lang.Object[] arguments)
Localizes a string depending on the localization settings of the Painter context |
java.lang.String |
localizeKey(java.lang.String resourceId,
java.lang.Object[] arguments,
boolean returnNull)
Localizes a string depending on the localization settings of the Painter context. |
void |
open()
The painter context has to be opened before it can be used. |
void |
popAttributes()
Restores the attributes from the Stack all current attributes are lost |
void |
pushAttributes()
Pushes the current attributes on a stack for later restore |
java.lang.Object |
removeAttribute(java.lang.String key)
Removes an Attribute for this Painter |
java.lang.String |
removeHtml(java.lang.Object html)
Removes all HTML formatting from the given HTML-String |
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 |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets an Attribute for this Painter |
void |
setFactory(PainterFactory factory)
Sets the painter factory |
boolean |
showComments()
This method checks if HTML comments should be written to the output |
java.lang.String |
truncate(java.lang.Object obj,
int maxlength)
Truncates a given string to a maximum number of characters |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private javax.servlet.jsp.PageContext pageContext
private Control control
private java.util.Locale locale
private PainterContext parentContext
private Principal principal
private PainterFactory factory
private java.util.Hashtable attributes
private java.util.Stack attributesSave
| Constructor Detail |
public PainterContextImp(javax.servlet.jsp.PageContext pageContext,
Control control)
pageContext - the JSP-PageContextcontrol - The selected Control| Method Detail |
protected java.util.Stack getContextStack()
public void open()
open in interface PainterContextpublic void close()
close in interface PainterContextpublic java.lang.String getElementName()
getElementName in interface PainterContextprotected void initLocale()
public void setFactory(PainterFactory factory)
setFactory in interface PainterContextfactory - Painter factorypublic javax.servlet.jsp.PageContext getPageContext()
getPageContext in interface PainterContextpublic RequestContext getNestedContext()
RequestContext
getNestedContext in interface RequestContextRequestContext.getNestedContext()public Principal getPrincipal()
RequestContext
getPrincipal in interface RequestContextRequestContext.getPrincipal()public javax.servlet.http.HttpSession getSession()
nullpublic javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public java.lang.String getAsString(Converter converter,
java.lang.Object value)
throws ConverterException
getAsString in interface PainterContextconverter - 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)
decorateURL in interface PainterContexturl - the URL to encode
public java.lang.String getResourceDir()
getResourceDir in interface PainterContextpublic java.lang.String getStringResource(java.lang.String stringOrKey)
getStringResource in interface PainterContextstringOrKey - Id of the resource/key
public java.lang.String getFrameworkString(java.lang.String resourceId)
getFrameworkString in interface PainterContextresourceId - Id of the resource/key
public java.lang.String getFrameworkString(java.lang.String resourceId,
java.lang.Object[] arguments)
getFrameworkString in interface PainterContextresourceId - Id of the resource/keyarguments - MessageFormat arguments
public ImageModel getImage(java.lang.String resourceId)
getImage in interface PainterContextresourceId - Image Code
null
public ImageModel getImage(int size,
java.lang.String resourceId)
getImage in interface PainterContextsize - Image sizeresourceId - Image Code
null
public ImageModel getImage(java.lang.String resourceId,
java.lang.Object param)
getImage in interface PainterContextresourceId - Image Codeparam - Markup parameter
nullpublic java.lang.String getImageSrc(java.lang.String resourceId)
getImageSrc in interface PainterContextresourceId - Image Code
public java.lang.String getImageSrc(java.lang.String resourceId,
java.lang.Object param)
getImageSrc in interface PainterContextresourceId - Image Codeparam - Markup Parameter
public java.lang.String getImageSrc(int size,
java.lang.String resourceId)
getImageSrc in interface PainterContextsize - Image sizeresourceId - Image Code
public Color getColor(java.lang.String resourceId)
getColor in interface PainterContextresourceId - Color Code
nullpublic java.awt.Color getAwtColor(java.lang.String resourceId)
getAwtColor in interface PainterContextresourceId - Color Code
nullpublic Control getControl()
getControl in interface PainterContextpublic boolean isRunAtClient()
isRunAtClient in interface PainterContexttrue when the component should run on the
clientpublic java.lang.String getStyleId()
getStyleId in interface PainterContextpublic boolean showComments()
showComments in interface PainterContextfalse when comments should be hiddenpublic boolean isDisplayOnly()
isDisplayOnly in interface PainterContexttrue if a control should be rendered as
display onlypublic ActionPainter createActionPainter(ControlActionDef action)
createActionPainter in interface PainterContextaction - ControlAction
public ActionPainter createActionPainter(ControlActionDef action,
java.lang.String actionName)
createActionPainter in interface PainterContextaction - ControlActionactionName - Additional Action Name
public org.apache.ecs.html.Input createInput(ImageModel image)
createInput in interface PainterContextimage - Image
nullpublic org.apache.ecs.html.Input createInput(java.lang.String resourceId)
createInput in interface PainterContextresourceId - Image Code
nullpublic org.apache.ecs.html.IMG createImage(ImageModel image)
createImage in interface PainterContextimage - Image
nullpublic org.apache.ecs.html.IMG createImage(java.lang.String resourceId)
createImage in interface PainterContextresourceId - Image Code
null
public org.apache.ecs.html.IMG createImage(java.lang.String resourceId,
java.lang.Object param)
createImage in interface PainterContextresourceId - Image Codeparam - Markup parameter
null
public org.apache.ecs.html.IMG createImage(int size,
java.lang.String resourceId)
createImage in interface PainterContextsize - Image sizeresourceId - Image Code
nullpublic java.util.Locale getLocale()
getLocale in interface PainterContextpublic java.lang.String localize(java.lang.String keyOrString)
localize in interface PainterContextkeyOrString - String Literal or Resource Key
public java.lang.String localize(java.lang.String keyOrString,
java.util.Locale locale)
localize in interface PainterContextkeyOrString - String Literal or Resource Keylocale - the locale to use
public java.lang.String localize(java.lang.String keyOrString,
java.lang.Object[] arguments)
localize in interface PainterContextkeyOrString - String Literal or Resource Keyarguments - MessageFormat arguments
public java.lang.String localizeKey(java.lang.String resourceId,
java.lang.Object[] arguments,
boolean returnNull)
localizeKey in interface PainterContextresourceId - The resource key.arguments - MessageFormat arguments or nullreturnNull - controls whether to return null or a not present indicator
public java.lang.String removeHtml(java.lang.Object html)
PainterContext
removeHtml in interface PainterContexthtml - Object in HTML format
PainterContext.removeHtml(java.lang.Object)
public java.lang.String removeHtml(java.lang.Object html,
boolean filter)
PainterContext
removeHtml in interface PainterContexthtml - Object in HTML formatfilter - Filter
PainterContext.removeHtml(java.lang.Object, boolean)public java.lang.String html(java.lang.Object raw)
html in interface PainterContextraw - Object
public java.lang.String html(java.lang.Object raw,
boolean filter)
html in interface PainterContextraw - Objectfilter - Filter
public java.lang.String html(java.lang.Object raw,
boolean filter,
int maxlength)
html in interface PainterContextraw - Objectfilter - Filtermaxlength - The maximum number of visible characters
public java.lang.String attr(java.lang.Object raw)
attr in interface PainterContextraw - Object
public java.lang.String attr(java.lang.Object raw,
boolean filter)
attr in interface PainterContextraw - Objectfilter - Filter
public java.lang.String attr(java.lang.Object raw,
boolean filter,
int maxlength)
attr in interface PainterContextraw - Objectfilter - Filtermaxlength - The maximum number of visible characters
public java.lang.String truncate(java.lang.Object obj,
int maxlength)
truncate in interface PainterContextobj - The string to truncatemaxlength - The maximum number of characters
public java.lang.String getSource(java.lang.String base,
java.lang.String src)
getSource in interface PainterContextbase - Base Directory or resource Identifiersrc - Resource name
public java.lang.String getSource(ImageModel image)
getSource in interface PainterContextimage - Image Model
public void setAttribute(java.lang.String key,
java.lang.Object value)
setAttribute in interface PainterContextkey - Attribute Keyvalue - Attribute Valuepublic java.lang.Object removeAttribute(java.lang.String key)
removeAttribute in interface PainterContextkey - Attribute Key
null
public java.lang.Object getAttribute(java.lang.String key,
boolean searchParent)
getAttribute in interface PainterContextkey - Attribute KeysearchParent - if set to true the attribute will be search up
the PainterContext hierarchy
null
public boolean hasAttribute(java.lang.String key,
boolean searchParent)
hasAttribute in interface PainterContextkey - Attribute KeysearchParent - if set to true the attribute will be search up
the PainterContext hierarchy
nullpublic void pushAttributes()
pushAttributes in interface PainterContextpublic void popAttributes()
popAttributes in interface PainterContext
public java.lang.Object getAttribute(java.lang.String name,
HttpScope scope)
HttpContext
getAttribute in interface HttpContextname - the attribute namescope - the scope to search
nullHttpContext.getAttribute(java.lang.String, com.cc.framework.http.HttpScope)public javax.servlet.ServletContext getServletContext()
HttpContext
getServletContext in interface HttpContextHttpContext.getServletContext()public javax.servlet.http.HttpServletRequest request()
HttpContext
request in interface HttpContextHttpContext.request()public javax.servlet.http.HttpServletResponse response()
HttpContext
response in interface HttpContextHttpContext.response()public javax.servlet.http.HttpSession session()
HttpContext
session in interface HttpContextHttpContext.session()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||