com.cc.framework.ui.painter.def
Class DefActionPainter

java.lang.Object
  extended bycom.cc.framework.ui.painter.def.DefActionPainter
All Implemented Interfaces:
ActionPainter

public class DefActionPainter
extends java.lang.Object
implements ActionPainter

The ActionPainter Class is responsible to generate a HTML-Element to initiate an Action

Since:
1.0
Version:
$Revision$
Author:
Harald Schulz

Field Summary
private  ControlAction action
          ControlAction
private  boolean active
          Indicates if the User is allowed to activated the Action
private  ClientHandler additionalHandler
          Additional client handlers which can be set with a call to addClientHandler()
private  java.lang.String anchor
          Anchor
private  PainterContext ctx
          Painter context
private  ClientHandler handler
          Access to the client handler
private  ImageModel image
          ImageModel
private  AlignmentType imageAlign
          Specifies the alignment of the image (in front of / or behind the label)
private  java.lang.String imageStyle
          Additional image style
private  AlignmentType imageVAlign
          Specifies the vertical alignment of the image (in front of / or behind the label)
private  java.lang.String label
          Label
private  java.lang.String linkName
          The anchor name to be defined within this page, so that you can reference it with intra-page Hyperlinks.
private  java.lang.String style
          Style
private  java.lang.String styleClass
          StyleClass
private  java.lang.String styleId
          StyleId
private  java.lang.String target
          Target
private  java.lang.String tooltip
          Tooltip
 
Constructor Summary
DefActionPainter(PainterContext ctx, ControlAction action)
          Constructor for ActionPainter
 
Method Summary
protected  void addAjaxHandlers(org.apache.ecs.html.A anchor)
           
 void addEventHandler(ClientEvent event, java.lang.String handler)
          Adds an additional event handler to this painter
 void addParameter(boolean value)
          Method addParameter
 void addParameter(java.lang.Boolean value)
          Method addParameter
 void addParameter(int value)
          Method addParameter
 void addParameter(java.lang.Integer value)
          Method addParameter
 void addParameter(long value)
          Method addParameter
 void addParameter(java.lang.Long value)
          Method addParameter
 void addParameter(java.lang.Object obj)
          Method addParameter
 void addParameter(java.lang.String value)
          Method addParameter
protected  java.lang.String createActionHref()
          Creates the actions Hyperlink
protected  java.lang.String createAjaxOnClick(AjaxSettings settings)
           
protected  org.apache.ecs.ConcreteElement createBody()
          Creates the passive Element which is visible to the user
 org.apache.ecs.ConcreteElement createElement()
          Creates an HTML Element which makes it possible to choose the Action on the user interface.
protected  org.apache.ecs.html.IMG createImage()
          Creates the Image
protected  org.apache.ecs.ConcreteElement createLink(org.apache.ecs.ConcreteElement linkBody)
          Creates an active Element which makes it possible to choose the Action on the user interface.
 ControlAction getAction()
          return the Action
protected  ClientHandler getAdditionalHandler()
           
 java.lang.String getAnchor()
           
protected  PainterContext getCtx()
           
protected  ClientHandler getHandler()
           
 ImageModel getImage()
          Returns the Image
 AlignmentType getImageAlign()
          Returns the alignment of an additional image
 java.lang.String getImageStyle()
           
 AlignmentType getImageVAlign()
          Returns the vertical alignment of an additional image
 java.lang.String getLabel()
          Returns the Label
 java.lang.String getLinkName()
           
 java.lang.String getStyle()
          Returns the Style
 java.lang.String getStyleClass()
          Returns the StyleClass
 java.lang.String getStyleId()
          Returns the StyleId
 java.lang.String getTarget()
          Returns the Target
 java.lang.String getTooltip()
          Returns the Tooltip
 boolean isActive()
          Returns the Active Flag
 boolean isFormAction()
          Returns the form action Flag
 void setActive(boolean b)
          Sets the Active Flag
 void setAnchor(java.lang.String anchor)
          Sets the Anchor to appended to the URL (#anchor)
 void setBehavior(ActionBehavior behavior)
          Sets some information about the actions behavior.
 void setClientHandler(ClientHandler handler)
          sets the Client Event Handlers
 void setImage(ImageModel image)
          Sets the Image
 void setImage(java.lang.String imageResource)
          Deprecated. use setImage(ImageModel) instead
 void setImage(java.lang.String imageResource, int width, int height)
          Deprecated. use setImage(ImageModel) instead
 void setImageAlign(AlignmentType type)
          Sets the alignment of an additional image
 void setImageStyle(java.lang.String style)
          Sets an additional image Style
 void setImageVAlign(AlignmentType type)
          Sets the vertical alignment of an additional image
 void setLabel(java.lang.String label)
          Sets the Label.
 void setLinkName(java.lang.String linkName)
          The anchor name to be defined within this page, so that you can reference it with intra-page hyperlinks.
 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 setTarget(java.lang.String target)
          Sets the Target
 void setTooltip(java.lang.String tooltip)
          Sets the ToolTip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

private ControlAction action
ControlAction


active

private boolean active
Indicates if the User is allowed to activated the Action


image

private ImageModel image
ImageModel


imageStyle

private java.lang.String imageStyle
Additional image style


label

private java.lang.String label
Label


tooltip

private java.lang.String tooltip
Tooltip


style

private java.lang.String style
Style


styleId

private java.lang.String styleId
StyleId


styleClass

private java.lang.String styleClass
StyleClass


target

private java.lang.String target
Target


anchor

private java.lang.String anchor
Anchor


linkName

private java.lang.String linkName
The anchor name to be defined within this page, so that you can reference it with intra-page Hyperlinks. In other words, the value specified here will render a "name" element in the generated anchor tag.


handler

private ClientHandler handler
Access to the client handler


additionalHandler

private ClientHandler additionalHandler
Additional client handlers which can be set with a call to addClientHandler()


ctx

private PainterContext ctx
Painter context


imageAlign

private AlignmentType imageAlign
Specifies the alignment of the image (in front of / or behind the label)


imageVAlign

private AlignmentType imageVAlign
Specifies the vertical alignment of the image (in front of / or behind the label)

Constructor Detail

DefActionPainter

public DefActionPainter(PainterContext ctx,
                        ControlAction action)
Constructor for ActionPainter

Parameters:
ctx - Painter Context
action - ControlAction
Method Detail

isFormAction

public boolean isFormAction()
Description copied from interface: ActionPainter
Returns the form action Flag

Specified by:
isFormAction in interface ActionPainter
Returns:
boolean returns true when this action link should submit the enclosing HTML form
See Also:
ActionPainter.isFormAction()

addEventHandler

public void addEventHandler(ClientEvent event,
                            java.lang.String handler)
Description copied from interface: ActionPainter
Adds an additional event handler to this painter

Specified by:
addEventHandler in interface ActionPainter
Parameters:
event - Event
handler - ScriptCode
See Also:
ActionPainter.addEventHandler(com.cc.framework.ui.model.ClientEvent, java.lang.String)

addParameter

public void addParameter(java.lang.Object obj)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
obj - Object
See Also:
ActionPainter.addParameter(java.lang.Object)

addParameter

public void addParameter(java.lang.String value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(java.lang.String)

addParameter

public void addParameter(java.lang.Integer value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(java.lang.Integer)

addParameter

public void addParameter(int value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(int)

addParameter

public void addParameter(java.lang.Long value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(java.lang.Long)

addParameter

public void addParameter(long value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(long)

addParameter

public void addParameter(java.lang.Boolean value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(java.lang.Boolean)

addParameter

public void addParameter(boolean value)
Description copied from interface: ActionPainter
Method addParameter

Specified by:
addParameter in interface ActionPainter
Parameters:
value - Value
See Also:
ActionPainter.addParameter(boolean)

setImage

public void setImage(java.lang.String imageResource)
Deprecated. use setImage(ImageModel) instead

Sets the Image, which should be associated with the Action

Parameters:
imageResource - ImageResource

setImage

public void setImage(java.lang.String imageResource,
                     int width,
                     int height)
Deprecated. use setImage(ImageModel) instead

Sets the Image, which should be associated with the Action

Parameters:
imageResource - ImageResource
width - Image Width
height - Image Height

setImage

public void setImage(ImageModel image)
Description copied from interface: ActionPainter
Sets the Image

Specified by:
setImage in interface ActionPainter
Parameters:
image - ImageModel
See Also:
ActionPainter.setImage(com.cc.framework.ui.model.ImageModel)

setImageStyle

public void setImageStyle(java.lang.String style)
Description copied from interface: ActionPainter
Sets an additional image Style

Specified by:
setImageStyle in interface ActionPainter
Parameters:
style - Image style
See Also:
ActionPainter.setImageStyle(java.lang.String)

setClientHandler

public void setClientHandler(ClientHandler handler)
Description copied from interface: ActionPainter
sets the Client Event Handlers

Specified by:
setClientHandler in interface ActionPainter
Parameters:
handler - Client Handler
See Also:
ActionPainter.setClientHandler(com.cc.framework.ui.model.ClientHandler)

setTooltip

public void setTooltip(java.lang.String tooltip)
Description copied from interface: ActionPainter
Sets the ToolTip

Specified by:
setTooltip in interface ActionPainter
Parameters:
tooltip - ToolTip
See Also:
ActionPainter.setTooltip(java.lang.String)

setTarget

public void setTarget(java.lang.String target)
Description copied from interface: ActionPainter
Sets the Target

Specified by:
setTarget in interface ActionPainter
Parameters:
target - Target
See Also:
ActionPainter.setTarget(java.lang.String)

setAnchor

public void setAnchor(java.lang.String anchor)
Description copied from interface: ActionPainter
Sets the Anchor to appended to the URL (#anchor)

Specified by:
setAnchor in interface ActionPainter
Parameters:
anchor - Anchor
See Also:
ActionPainter.setAnchor(java.lang.String)

setLinkName

public void setLinkName(java.lang.String linkName)
Description copied from interface: ActionPainter
The anchor name to be defined within this page, so that you can reference it with intra-page hyperlinks. In other words, the value specified here will render a "name" element in the generated anchor tag.

Specified by:
setLinkName in interface ActionPainter
Parameters:
linkName - Link Name
See Also:
ActionPainter.setLinkName(java.lang.String)

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: ActionPainter
Sets the Label. If necessary the label must be HTML encoded and localized first. This is not done by the ActionPainter

Specified by:
setLabel in interface ActionPainter
Parameters:
label - Label
See Also:
ActionPainter.setLabel(java.lang.String)

setStyle

public void setStyle(java.lang.String style)
Description copied from interface: ActionPainter
Sets the Style

Specified by:
setStyle in interface ActionPainter
Parameters:
style - Style
See Also:
ActionPainter.setStyle(java.lang.String)

setStyleId

public void setStyleId(java.lang.String styleId)
Description copied from interface: ActionPainter
Sets the StyleId

Specified by:
setStyleId in interface ActionPainter
Parameters:
styleId - StyleId
See Also:
ActionPainter.setStyleId(java.lang.String)

setStyleClass

public void setStyleClass(java.lang.String styleClass)
Description copied from interface: ActionPainter
Sets the StyleClass

Specified by:
setStyleClass in interface ActionPainter
Parameters:
styleClass - StyleClass
See Also:
ActionPainter.setStyleClass(java.lang.String)

setBehavior

public void setBehavior(ActionBehavior behavior)
Description copied from interface: ActionPainter
Sets some information about the actions behavior.

Specified by:
setBehavior in interface ActionPainter
Parameters:
behavior - Directs the framework to include a transaction token (if any) in all generated hyperlinks. The Transaction token is used to track form re-submissions. enables the AJAX handlers for this action
See Also:
ActionPainter.setBehavior(com.cc.framework.ui.model.ActionBehavior)

getAction

public ControlAction getAction()
Description copied from interface: ActionPainter
return the Action

Specified by:
getAction in interface ActionPainter
Returns:
ControlAction
See Also:
ActionPainter.getAction()

getAnchor

public java.lang.String getAnchor()
Specified by:
getAnchor in interface ActionPainter
Returns:
the Anchor to appended to the URL (#anchor)
See Also:
ActionPainter.getAnchor()

getImage

public ImageModel getImage()
Description copied from interface: ActionPainter
Returns the Image

Specified by:
getImage in interface ActionPainter
Returns:
ImageModel
See Also:
ActionPainter.getImage()

getImageStyle

public java.lang.String getImageStyle()
Specified by:
getImageStyle in interface ActionPainter
Returns:
an additional image Style
See Also:
ActionPainter.getImageStyle()

getHandler

protected ClientHandler getHandler()
Returns:
returns the client handlers

getAdditionalHandler

protected ClientHandler getAdditionalHandler()
Returns:
returns the additional client handlers

getCtx

protected PainterContext getCtx()
Returns:
returns the painter context

getLabel

public java.lang.String getLabel()
Description copied from interface: ActionPainter
Returns the Label

Specified by:
getLabel in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getLabel()

getLinkName

public java.lang.String getLinkName()
Specified by:
getLinkName in interface ActionPainter
Returns:
The anchor name to be defined within this page, so that you can reference it with intra-page hyperlinks. In other words, the value specified here will render a "name" element in the generated anchor tag.
See Also:
ActionPainter.getLinkName()

getStyle

public java.lang.String getStyle()
Description copied from interface: ActionPainter
Returns the Style

Specified by:
getStyle in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getStyle()

getStyleClass

public java.lang.String getStyleClass()
Description copied from interface: ActionPainter
Returns the StyleClass

Specified by:
getStyleClass in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getStyleClass()

getStyleId

public java.lang.String getStyleId()
Description copied from interface: ActionPainter
Returns the StyleId

Specified by:
getStyleId in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getStyleId()

getTarget

public java.lang.String getTarget()
Description copied from interface: ActionPainter
Returns the Target

Specified by:
getTarget in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getTarget()

getTooltip

public java.lang.String getTooltip()
Description copied from interface: ActionPainter
Returns the Tooltip

Specified by:
getTooltip in interface ActionPainter
Returns:
String
See Also:
ActionPainter.getTooltip()

isActive

public boolean isActive()
Description copied from interface: ActionPainter
Returns the Active Flag

Specified by:
isActive in interface ActionPainter
Returns:
boolean
See Also:
ActionPainter.isActive()

setActive

public void setActive(boolean b)
Description copied from interface: ActionPainter
Sets the Active Flag

Specified by:
setActive in interface ActionPainter
Parameters:
b - Flag
See Also:
ActionPainter.setActive(boolean)

getImageAlign

public AlignmentType getImageAlign()
Description copied from interface: ActionPainter
Returns the alignment of an additional image

Specified by:
getImageAlign in interface ActionPainter
Returns:
AlignmentType
See Also:
ActionPainter.getImageAlign()

setImageAlign

public void setImageAlign(AlignmentType type)
Description copied from interface: ActionPainter
Sets the alignment of an additional image

Specified by:
setImageAlign in interface ActionPainter
Parameters:
type - Alignment Type
See Also:
ActionPainter.setImageAlign(com.cc.framework.ui.AlignmentType)

getImageVAlign

public AlignmentType getImageVAlign()
Description copied from interface: ActionPainter
Returns the vertical alignment of an additional image

Specified by:
getImageVAlign in interface ActionPainter
Returns:
AlignmentType
See Also:
ActionPainter.getImageVAlign()

setImageVAlign

public void setImageVAlign(AlignmentType type)
Description copied from interface: ActionPainter
Sets the vertical alignment of an additional image

Specified by:
setImageVAlign in interface ActionPainter
Parameters:
type - Alignment Type
See Also:
ActionPainter.setImageVAlign(com.cc.framework.ui.AlignmentType)

createActionHref

protected java.lang.String createActionHref()
Creates the actions Hyperlink

Returns:
String

createElement

public org.apache.ecs.ConcreteElement createElement()
Description copied from interface: ActionPainter
Creates an HTML Element which makes it possible to choose the Action on the user interface.

Specified by:
createElement in interface ActionPainter
Returns:
ConcreteElement
See Also:
ActionPainter.createElement()

createImage

protected org.apache.ecs.html.IMG createImage()
Creates the Image

Returns:
IMG

createBody

protected org.apache.ecs.ConcreteElement createBody()
Creates the passive Element which is visible to the user

Returns:
ConcreteElement

createLink

protected org.apache.ecs.ConcreteElement createLink(org.apache.ecs.ConcreteElement linkBody)
Creates an active Element which makes it possible to choose the Action on the user interface.

Parameters:
linkBody - The nested link body
Returns:
ConcreteElement

addAjaxHandlers

protected void addAjaxHandlers(org.apache.ecs.html.A anchor)

createAjaxOnClick

protected java.lang.String createAjaxOnClick(AjaxSettings settings)


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