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

java.lang.Object
  extended bycom.cc.framework.ui.painter.def.DefMenuItemPainter

public class DefMenuItemPainter
extends java.lang.Object

This class is used to create the menu java script elements

Author:
Harald Schulz

Field Summary
private  PainterContext ctx
          The painter context
 
Constructor Summary
DefMenuItemPainter(PainterContext ctx)
          Constructor
 
Method Summary
 void appendItemsToScript(java.lang.String scope, java.lang.StringBuffer buf, MenuItem[] items, ImageMap images)
          Appends the menu item script
protected  java.lang.String encodeMenuState(int menuState)
           
static ImageModel getItemImage(MenuItem item, ImageMap images)
          Retrieves the image for the given menu item
static java.lang.String getItemImageSrc(PainterContext ctx, MenuItem item, ImageMap images)
          Retrieves the image source for the given menu item
static java.lang.String getItemText(PainterContext ctx, MenuItem item)
          Retrieves the (localized) text for the given item
static java.util.Locale getLocale(PainterContext ctx, MenuItem item)
          Retrieves the locale to use for a given menu item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

private PainterContext ctx
The painter context

Constructor Detail

DefMenuItemPainter

public DefMenuItemPainter(PainterContext ctx)
Constructor

Parameters:
ctx - the painter context
Method Detail

appendItemsToScript

public void appendItemsToScript(java.lang.String scope,
                                java.lang.StringBuffer buf,
                                MenuItem[] items,
                                ImageMap images)
Appends the menu item script

Parameters:
scope - JavaScript scope name
buf - the script buffer
items - items to add
images - the image map for image translation

encodeMenuState

protected java.lang.String encodeMenuState(int menuState)

getItemText

public static java.lang.String getItemText(PainterContext ctx,
                                           MenuItem item)
Retrieves the (localized) text for the given item

Parameters:
ctx - painter context
item - the menu item
Returns:
the items text

getItemImageSrc

public static java.lang.String getItemImageSrc(PainterContext ctx,
                                               MenuItem item,
                                               ImageMap images)
Retrieves the image source for the given menu item

Parameters:
ctx - painter context
item - the menu item
images - the image map
Returns:
image or null

getItemImage

public static ImageModel getItemImage(MenuItem item,
                                      ImageMap images)
Retrieves the image for the given menu item

Parameters:
item - the menu item
images - the image map
Returns:
image or null

getLocale

public static java.util.Locale getLocale(PainterContext ctx,
                                         MenuItem item)
Retrieves the locale to use for a given menu item

Parameters:
ctx - painter context
item - Panel item
Returns:
Locale


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