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

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPainter
      extended bycom.cc.framework.ui.painter.def.DefPainterBase
          extended bycom.cc.framework.ui.painter.def.DefButtonPainter

public class DefButtonPainter
extends DefPainterBase

HTML painter for the button control

Since:
1.0
Version:
$Revision: 1.60 $
Author:
Gernot Schulz

Field Summary
private static java.lang.String ONCLICK_CANCEL
           
private static java.lang.String ONCLICK_RESET
           
private static java.lang.String ONCLICK_SUBMIT
           
private static java.lang.String ONCLICK_USERDEF
          onClick-Handler for an user defined button
 
Fields inherited from class com.cc.framework.ui.painter.ControlPainter
log
 
Constructor Summary
DefButtonPainter(PainterContext painterContext, ButtonControl ctrl)
          Constructor
 
Method Summary
protected  org.apache.ecs.html.IMG disableImg(org.apache.ecs.html.IMG image)
          If an image button is disabled the correct image must be used.
protected  java.lang.String disableImg(java.lang.String imgSrc)
          If an image button is disabled the correct image must be used.
protected  org.apache.ecs.ConcreteElement doCreateButtonBody()
          Creates the text buttons body element
protected  org.apache.ecs.ConcreteElement doCreateElement()
          Creates the HTML-Element.
protected  org.apache.ecs.ConcreteElement doCreateImageButton()
          Creates a image button
protected  org.apache.ecs.ConcreteElement doCreateTextButton()
          Creates a text button
protected  void doSetImageButtonHandlers(org.apache.ecs.html.Input imagebutton)
          Assigns the JavaScript handlers to the image button
protected  void doSetTextButtonHandlers(org.apache.ecs.MultiPartElement textbutton)
          Assigns the JavaScript handlers to the text button
protected  java.lang.String getButtonId()
          Retrieves the button id
protected  ButtonControl getCtrl()
          Retrieves the control for this painter
 
Methods inherited from class com.cc.framework.ui.painter.def.DefPainterBase
createHelpElement, createHelpElement, doCreateHelpButton, doCreateHelpIcon, getElementClass
 
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, doAfterCreate, doAttachDecorations, doBeforeCreate, 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

ONCLICK_SUBMIT

private static final java.lang.String ONCLICK_SUBMIT
See Also:
Constant Field Values

ONCLICK_CANCEL

private static final java.lang.String ONCLICK_CANCEL
See Also:
Constant Field Values

ONCLICK_RESET

private static final java.lang.String ONCLICK_RESET
See Also:
Constant Field Values

ONCLICK_USERDEF

private static final java.lang.String ONCLICK_USERDEF
onClick-Handler for an user defined button

See Also:
Constant Field Values
Constructor Detail

DefButtonPainter

public DefButtonPainter(PainterContext painterContext,
                        ButtonControl ctrl)
Constructor

Parameters:
painterContext - The PainterContext
ctrl - The Control to render
Method Detail

getCtrl

protected ButtonControl getCtrl()
Retrieves the control for this painter

Returns:
Control

getButtonId

protected java.lang.String getButtonId()
Retrieves the button id

Returns:
button id

doCreateTextButton

protected org.apache.ecs.ConcreteElement doCreateTextButton()
Creates a text button

Returns:
HTML Elements for a the text button

doSetTextButtonHandlers

protected void doSetTextButtonHandlers(org.apache.ecs.MultiPartElement textbutton)
Assigns the JavaScript handlers to the text button

Parameters:
textbutton - the text button element

doCreateButtonBody

protected org.apache.ecs.ConcreteElement doCreateButtonBody()
Creates the text buttons body element

Returns:
body element

doCreateImageButton

protected org.apache.ecs.ConcreteElement doCreateImageButton()
Creates a image button

Returns:
HTML Elements for a the image button

doSetImageButtonHandlers

protected void doSetImageButtonHandlers(org.apache.ecs.html.Input imagebutton)
Assigns the JavaScript handlers to the image button

Parameters:
imagebutton - the image button element

doCreateElement

protected org.apache.ecs.ConcreteElement doCreateElement()
Description copied from class: ControlPainter
Creates the HTML-Element. This Method must be implemented by the concrete Sub-Class

Specified by:
doCreateElement in class ControlPainter
Returns:
ConcreteElement
See Also:
ControlPainter.doCreateElement()

disableImg

protected java.lang.String disableImg(java.lang.String imgSrc)
If an image button is disabled the correct image must be used. To get the correct image the image is exchanged. Therefore the state xxxx1.gif is replaced by xxxx3.gif which stands for the disabled image.

Parameters:
imgSrc - The image source
Returns:
The new image source for the disabled button

disableImg

protected org.apache.ecs.html.IMG disableImg(org.apache.ecs.html.IMG image)
If an image button is disabled the correct image must be used. To get the correct image the image is exchanged. Therefore the state xxxx1.gif is replaced by xxxx3.gif which stands for the disabled image.

Parameters:
image - The image
Returns:
The image with changed src Attribute


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