com.sap.netweaver.bc.uwl.config

Class ImageMapping

java.lang.Object
  extended by com.sap.netweaver.bc.uwl.config.ImageMapping
All Implemented Interfaces:
Serializable, Cloneable

public class ImageMapping
extends Object
implements Cloneable, Serializable

 This class is used to create a mapping between item data
 and a corresponding image to be display in the UI.  Can also be used
 to map item data to a text string.  
 
 Example xml configuration:
        <DisplayAttribute name="status" type="user" ...>
                <ImageMapping default="enum">
                        <ImageMap value="enum" imageName="ico16_task_new.gif" referenceBundle="default_task_status" />
                        <ImageMap value="c" imageName="ico16_task_new.gif" referenceBundle="new_task_status" />
                        <ImageMap value="a" imageName="ico16_task_start.gif" referenceBundle="start_task_status" />
                        <ImageMap value="d" imageName="ico16_task_reject.gif" referenceBundle="reject_task_status" />
                        <ImageMap value="e" imageName="ico16_task_confirmed.gif" referenceBundle="confirmed_task_status" />
                        <ImageMap value="f" imageName="ico16_task_complete.gif" referenceBundle="completed_task_status" />
                </ImageMapping>
        </DisplayAttribute>

        In this exmaple the status item type is mapping letter values to a image.
        i.e. if "c" is return from the provider for any status it will convert it to the 
        ico16_task_new.gif when displaying the data in the UWL UI.
 

See Also:
Serialized Form

Nested Class Summary
static class ImageMapping.ImageMap
          Class for the ImageMapping.
 
Constructor Summary
ImageMapping(HashMap maps, String defaultKey)
          Constructor create a data coolection
 
Method Summary
 Object clone()
           
 ImageMapping.ImageMap getDefaultMap()
          Get the Default ImageMap to be used if no match is found.
 ImageMapping.ImageMap getImageMap(String key)
           
 Map getImageMaps()
          Access to the ImageMap collections
 boolean isDefault(ImageMapping.ImageMap map)
          Determine if this ImageMap is defined as the default.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMapping

public ImageMapping(HashMap maps,
                    String defaultKey)
Constructor create a data coolection

Parameters:
maps - - Map of ImageMap items
defaultKey -
Method Detail

getImageMap

public ImageMapping.ImageMap getImageMap(String key)
Parameters:
key -
Returns:

getImageMaps

public Map getImageMaps()
Access to the ImageMap collections

Returns:

isDefault

public boolean isDefault(ImageMapping.ImageMap map)
Determine if this ImageMap is defined as the default. The default is to be used if no match is found.

Parameters:
map -
Returns:

getDefaultMap

public ImageMapping.ImageMap getDefaultMap()
Get the Default ImageMap to be used if no match is found.

Returns:

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright 2009 SAP AG Complete Copyright Notice