com.cc.framework.ui.painter
Class ControlPortionPainter

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPortionPainter
Direct Known Subclasses:
DefFramePainterBase, DefSchedulerViewPainter

public abstract class ControlPortionPainter
extends java.lang.Object

This is the abstract Base Class for all Portion Painter. A Portion Painter has no own Painter Context. It uses the Painter Context of the Parent Control

Version:
$Revision: 1.13 $
Author:
Harald Schulz

Field Summary
private  ControlPainter ctrlPainter
          The Control Painter
 
Constructor Summary
ControlPortionPainter()
          Creates a new ViewPainter
 
Method Summary
 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
protected  ActionPainter createActionPainter(ControlActionDef action)
          Creates an ActionPainter.
protected  ActionPainter createActionPainter(ControlActionDef action, java.lang.String actionName)
          Creates an ActionPainter.
protected  org.apache.ecs.html.IMG createImage(ImageModel image)
          Creates an HTML image Tag for the specified image model
protected  org.apache.ecs.html.IMG createImage(java.lang.String resourceId)
          Retrieves an image for the specified Id
protected  org.apache.ecs.html.IMG createImage(java.lang.String resourceId, java.lang.Object param)
          Retrieves an image for the specified Id
protected  org.apache.ecs.ConcreteElement createSpacer(int height, int width)
          Creates a spacer image with the given dimension
protected  Color getColor(java.lang.String resourceId)
          Retrieves an color for the specified Id
protected  ControlPainter getControlPainter()
           
protected  java.lang.String getElementClass(int type)
          The method returns the HTML style class required for a list or treelist control.
protected  java.lang.String getFrameworkString(java.lang.String resourceId)
          Returns a framework string resource
protected  java.lang.String getFrameworkString(java.lang.String resourceId, java.lang.Object[] arguments)
          Retrieves an framework String for the specified Id
protected  ImageModel getImage(java.lang.String resourceId)
          Retrieves an image for the specified Id
protected  ImageModel getImage(java.lang.String resourceId, java.lang.Object param)
          Retrieves an image for the specified Id
protected  java.lang.String getImageSrc(java.lang.String resourceId)
          Retrieves an image for the specified Id
protected  java.lang.String getImageSrc(java.lang.String resourceId, java.lang.Object param)
          Retrieves an image for the specified Id
protected  java.util.Locale getLocale()
          Retrieves the current Locale
protected  javax.servlet.jsp.PageContext getPageContext()
          Returns the JSP page context
protected  PainterContext getPainterContext()
           
protected  Principal getPrincipal()
           
protected  java.util.Locale getSafeLocale()
          Retrieves the current Locale or the system locale when localization is not turned on
protected  java.lang.String html(java.lang.Object raw)
          Converts a String to an equivalent HTML-String
protected  java.lang.String html(java.lang.Object raw, boolean filter)
          Converts a String to an equivalent HTML-String
protected  java.lang.String html(java.lang.Object raw, boolean filter, int maxlength)
          Converts a String to an equivalent HTML-String
protected  boolean isRunAtClient()
          This Method checks if the control should run on the client
protected  java.lang.String localize(java.lang.String keyOrString)
          Localizes a string depending on the localization settings of the Painter context
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
 void setControlPainter(ControlPainter ctrlPainter)
          Sets the ControlPainter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctrlPainter

private ControlPainter ctrlPainter
The Control Painter

Constructor Detail

ControlPortionPainter

public ControlPortionPainter()
Creates a new ViewPainter

Method Detail

setControlPainter

public void setControlPainter(ControlPainter ctrlPainter)
Sets the ControlPainter

Parameters:
ctrlPainter - The Control Painter

getControlPainter

protected ControlPainter getControlPainter()
Returns:
ControlPainter

getPainterContext

protected PainterContext getPainterContext()
Returns:
PainterContext

isRunAtClient

protected boolean isRunAtClient()
This Method checks if the control should run on the client

Returns:
Returns true when the component should run on the client

getLocale

protected java.util.Locale getLocale()
Retrieves the current Locale

Returns:
Locale

getSafeLocale

protected java.util.Locale getSafeLocale()
Retrieves the current Locale or the system locale when localization is not turned on

Returns:
Locale

localize

protected java.lang.String localize(java.lang.String keyOrString)
Localizes a string depending on the localization settings of the Painter context

Parameters:
keyOrString - String Literal or Resource Key
Returns:
localized String

getPrincipal

protected Principal getPrincipal()
Returns:
Principal Object

createActionPainter

protected ActionPainter createActionPainter(ControlActionDef action,
                                            java.lang.String actionName)
Creates an ActionPainter. The Painter is used by Controls to render Actions into the user interface

Parameters:
action - ControlAction
actionName - Additional Action Name
Returns:
ActionPainter

getColor

protected Color getColor(java.lang.String resourceId)
Retrieves an color for the specified Id

Parameters:
resourceId - Color Code
Returns:
The Color or null

createImage

protected org.apache.ecs.html.IMG createImage(java.lang.String resourceId)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
Returns:
The Image or null

createImage

protected org.apache.ecs.html.IMG createImage(ImageModel image)
Creates an HTML image Tag for the specified image model

Parameters:
image - Image
Returns:
The Image or null

createImage

protected org.apache.ecs.html.IMG createImage(java.lang.String resourceId,
                                              java.lang.Object param)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
param - Markup Parameter
Returns:
The Image or null

getImageSrc

protected java.lang.String getImageSrc(java.lang.String resourceId)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
Returns:
The Image Source

getImageSrc

protected java.lang.String getImageSrc(java.lang.String resourceId,
                                       java.lang.Object param)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
param - Markup Parameter
Returns:
The Image Source

getImage

protected ImageModel getImage(java.lang.String resourceId)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
Returns:
The Image or null

getImage

protected ImageModel getImage(java.lang.String resourceId,
                              java.lang.Object param)
Retrieves an image for the specified Id

Parameters:
resourceId - Image Code
param - Markup Parameter
Returns:
The Image Source

createSpacer

protected org.apache.ecs.ConcreteElement createSpacer(int height,
                                                      int width)
Creates a spacer image with the given dimension

Parameters:
height - spacer height
width - spacer width
Returns:
Spacer Image

removeHtml

protected java.lang.String removeHtml(java.lang.Object html)
Removes all HTML formatting from the given HTML-String

Parameters:
html - Object in HTML format
Returns:
String

removeHtml

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

Parameters:
html - Object in HTML format
filter - Filter
Returns:
String

html

protected java.lang.String html(java.lang.Object raw)
Converts a String to an equivalent HTML-String

Parameters:
raw - Object
Returns:
String

html

protected java.lang.String html(java.lang.Object raw,
                                boolean filter)
Converts a String to an equivalent HTML-String

Parameters:
raw - Object
filter - Filter
Returns:
String

html

protected java.lang.String html(java.lang.Object raw,
                                boolean filter,
                                int maxlength)
Converts a String to an equivalent HTML-String

Parameters:
raw - Object
filter - Filter
maxlength - The maximum number of visible characters
Returns:
String

attr

public java.lang.String attr(java.lang.Object raw)
Converts a String to a valid HTML Attribute

Parameters:
raw - Object
Returns:
String

attr

public java.lang.String attr(java.lang.Object raw,
                             boolean filter)
Converts a String to a valid HTML Attribute

Parameters:
raw - Object
filter - Filter
Returns:
String

attr

public java.lang.String attr(java.lang.Object raw,
                             boolean filter,
                             int maxlength)
Converts a String to a valid HTML Attribute

Parameters:
raw - Object
filter - Filter
maxlength - The maximum number of visible characters
Returns:
String

getPageContext

protected javax.servlet.jsp.PageContext getPageContext()
Returns the JSP page context

Returns:
The jsp page context

getFrameworkString

protected java.lang.String getFrameworkString(java.lang.String resourceId)
Returns a framework string resource

Parameters:
resourceId - Id of the resource/key
Returns:
The value for the resource id

getFrameworkString

protected java.lang.String getFrameworkString(java.lang.String resourceId,
                                              java.lang.Object[] arguments)
Retrieves an framework String for the specified Id

Parameters:
resourceId - The resource id
arguments - MessageFormat arguments
Returns:
The String Source

createActionPainter

protected ActionPainter createActionPainter(ControlActionDef action)
Creates an ActionPainter. The Painter is used by Controls to render Actions into the user interface

Parameters:
action - ControlAction
Returns:
ActionPainter

getElementClass

protected java.lang.String getElementClass(int type)
The method returns the HTML style class required for a list or treelist control.

Parameters:
type - The required style class
Returns:
The style class


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