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

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.DefCrumbsPainter

public class DefCrumbsPainter
extends DefPainterBase

Painter class for the crumbs control

Since:
1.2
Version:
$Revision: 1.29 $
Author:
Gernot Schulz

Field Summary
protected static int FLAG_DISABLED
          Crumb is disabled
protected static int FLAG_FIRST
          This flag is set for the first visible crumb
protected static int FLAG_LAST
          This flag is set for the last visible crumb
protected static int FLAG_SELECTED
          Crumb is selected
protected static int FLAG_STATES
          Crumbs State Mask
protected static int FLAG_UNSELECTED
          Crumb is unselected
 
Fields inherited from class com.cc.framework.ui.painter.ControlPainter
log
 
Constructor Summary
DefCrumbsPainter(PainterContext painterContext, CrumbsControl ctrl)
          Constructor
 
Method Summary
protected  org.apache.ecs.html.IMG createImage(int lstate, int rstate)
          Retrieves the corner image for two adjacent crumbs
protected  org.apache.ecs.ConcreteElement doCreateCrumb(org.apache.ecs.ConcreteElement face, int lstate, int state, int rstate)
          This method creates the crumb element
protected  org.apache.ecs.ConcreteElement doCreateCrumbs(CrumbModel[] crumbs)
          Method doCreateCrumbs
protected  org.apache.ecs.ConcreteElement doCreateElement()
          Creates the HTML-Element.
protected  ImageModel getBgImage(int state)
          Retrieves the background image for the specified style
protected  ImageModel getCrumbImage(CrumbModel crumb, int state)
          Returns the Image of a crumb
protected  int getCrumbState(CrumbModel[] crumbs, int index)
          Calculates the state flags for the given crumb
protected  CrumbsControl getCtrl()
          Retrieves the control for this painter
protected  java.util.Locale getLocale(CrumbModel crumb)
          Retrieves the locale to use for a given content element
protected  java.lang.String getStyleClass(int state)
          Retrieves the style class for the specified crumb state
protected  boolean isOverlapping()
          Checks if the crumbs should be painted in overlapping mode
protected  boolean isSelected(CrumbModel crumb)
          Checks if the specified crumb is selected
 
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

FLAG_STATES

protected static final int FLAG_STATES
Crumbs State Mask

See Also:
Constant Field Values

FLAG_UNSELECTED

protected static final int FLAG_UNSELECTED
Crumb is unselected

See Also:
Constant Field Values

FLAG_SELECTED

protected static final int FLAG_SELECTED
Crumb is selected

See Also:
Constant Field Values

FLAG_DISABLED

protected static final int FLAG_DISABLED
Crumb is disabled

See Also:
Constant Field Values

FLAG_FIRST

protected static final int FLAG_FIRST
This flag is set for the first visible crumb

See Also:
Constant Field Values

FLAG_LAST

protected static final int FLAG_LAST
This flag is set for the last visible crumb

See Also:
Constant Field Values
Constructor Detail

DefCrumbsPainter

public DefCrumbsPainter(PainterContext painterContext,
                        CrumbsControl ctrl)
Constructor

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

getCtrl

protected CrumbsControl getCtrl()
Retrieves the control for this painter

Returns:
Control

isOverlapping

protected boolean isOverlapping()
Checks if the crumbs should be painted in overlapping mode

Returns:
true when overlapping crumbs should be drawn

getLocale

protected java.util.Locale getLocale(CrumbModel crumb)
Retrieves the locale to use for a given content element

Parameters:
crumb - Crumb element
Returns:
Locale

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()

isSelected

protected boolean isSelected(CrumbModel crumb)
Checks if the specified crumb is selected

Parameters:
crumb - CrumbDesignModel
Returns:
boolean

getCrumbState

protected int getCrumbState(CrumbModel[] crumbs,
                            int index)
Calculates the state flags for the given crumb

Parameters:
crumbs - The list of all visible crumbs
index - The crumbs index
Returns:
State flags

getStyleClass

protected java.lang.String getStyleClass(int state)
Retrieves the style class for the specified crumb state

Parameters:
state - the crumbs state
Returns:
Style class

getBgImage

protected ImageModel getBgImage(int state)
Retrieves the background image for the specified style

Parameters:
state - the crumbs state
Returns:
Background image

createImage

protected org.apache.ecs.html.IMG createImage(int lstate,
                                              int rstate)
Retrieves the corner image for two adjacent crumbs

Parameters:
lstate - State of the left crumb
rstate - State of the right crumb
Returns:
Corner image

doCreateCrumb

protected org.apache.ecs.ConcreteElement doCreateCrumb(org.apache.ecs.ConcreteElement face,
                                                       int lstate,
                                                       int state,
                                                       int rstate)
This method creates the crumb element

Parameters:
face - The crumbs face content
lstate - State of the left neighbor
state - State of the crumb
rstate - State of the right neighbor
Returns:
Crumbs face element

doCreateCrumbs

protected org.apache.ecs.ConcreteElement doCreateCrumbs(CrumbModel[] crumbs)
Method doCreateCrumbs

Parameters:
crumbs - the crumbs list
Returns:
ConcreteElement

getCrumbImage

protected ImageModel getCrumbImage(CrumbModel crumb,
                                   int state)
Returns the Image of a crumb

Parameters:
crumb - CrumbDesignModel
state - the selection state of the crumb
Returns:
ImageModel


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