com.sun.rave.designtime.markup
Interface MarkupDesignContext

All Superinterfaces:
DesignContext, DisplayItem
All Known Subinterfaces:
FacesDesignContext

public interface MarkupDesignContext
extends DesignContext

The MarkupDesignContext is an extension to the DesignContext interface that adds markup-specific functionality. This adds methods for previewing CSS style changes at design-time. A MarkupDesignContext can be accessed by calling the DesignBean.getDesignContext() method and testing the returned DesignContext for 'instanceof' MarkupDesignContext. If the file being designed is a markup backing file (eg: *.jsp), the DesignContext will be an instanceof MarkupDesignContext.

IMPLEMENTED BY CREATOR - This interface is implemented by Creator for use by the component (bean) author.

Version:
1.0
Author:
Joe Nuxoll
See Also:
DesignContext, DesignBean.getDesignContext()

Method Summary
 java.util.Map convertCssStyleToMap(java.lang.String cssStyle)
          Converts a CSS inline style string into a Map of style elements
 java.lang.String convertMapToCssStyle(java.util.Map cssStyleMap)
          Converts a Map of CSS styles into an inline CSS style string
 java.awt.Image getCssPreviewImage(java.lang.String cssStyle, java.lang.String[] cssStyleClasses, MarkupDesignBean designBean, int width, int height)
          Generates and returns a preview image (sized width x height) of the specified MarkupDesignBean after applying the specified CSS styles and style classes to the rendered markup.
 
Methods inherited from interface com.sun.rave.designtime.DesignContext
addDesignContextListener, addResource, canCreateBean, canMoveBean, copyBeans, createBean, deleteBean, getBeanByName, getBeanForInstance, getBeans, getBeansOfType, getContextData, getDesignContextListeners, getProject, getRootContainer, moveBean, pasteBeans, removeDesignContextListener, resolveResource, setContextData
 
Methods inherited from interface com.sun.rave.designtime.DisplayItem
getDescription, getDisplayName, getHelpKey, getLargeIcon, getSmallIcon
 

Method Detail

convertCssStyleToMap


public java.util.Map convertCssStyleToMap(java.lang.String cssStyle)
Converts a CSS inline style string into a Map of style elements

Parameters:
cssStyle - The CSS inline style string to convert
Returns:
A Map containing the parsed CSS styles

convertMapToCssStyle


public java.lang.String convertMapToCssStyle(java.util.Map cssStyleMap)
Converts a Map of CSS styles into an inline CSS style string

Parameters:
cssStyleMap - The Map of CSS styles to convert
Returns:
An inline CSS style string

getCssPreviewImage


public java.awt.Image getCssPreviewImage(java.lang.String cssStyle,
                                         java.lang.String[] cssStyleClasses,
                                         MarkupDesignBean designBean,
                                         int width,
                                         int height)
Generates and returns a preview image (sized width x height) of the specified MarkupDesignBean after applying the specified CSS styles and style classes to the rendered markup.

Parameters:
cssStyle - The CSS style string to apply to the rendered markup from the MarkupDesignBean
cssStyleClasses - The CSS style classes to apply to the rendered markup from the MarkupDesignBean
designBean - The MarkupDesignBean to render the image of
width - The desired width of the resulting image (in pixels)
height - The desired height of the resulting image (in pixels)
Returns:
The generated Image representing the MarkupDesignBean render output with the applied styles