org.eclipse.birt.chart.factory
Class RunTimeContext

java.lang.Object
  extended byorg.eclipse.birt.chart.factory.RunTimeContext
All Implemented Interfaces:
java.io.Serializable

public final class RunTimeContext
extends java.lang.Object
implements java.io.Serializable

Encapsulates runtime information associated with each chart generation and rendering session. It contains global objects that are defined per request.

See Also:
Serialized Form

Constructor Summary
RunTimeContext()
          A default zero-arg public constructor used for object creation.
 
Method Summary
 void clearState()
          Clears all the stored states.
 java.lang.String externalizedMessage(java.lang.String sChartKey)
          A convenience method provided to lookup externalized messages associated with a given message key.
 IActionRenderer getActionRenderer()
          Returns the IActionRenderer of current runtime context.
 java.util.Locale getLocale()
          Returns the locale associated with this runtime context.
 org.eclipse.birt.core.i18n.ResourceHandle getResourceHandle()
          Returns an instance of the resource handle for which chart specific messages are externalized.
 IScriptClassLoader getScriptClassLoader()
          Returns the script classLoader if available.
 IChartScriptContext getScriptContext()
          Returns an instance of a script context associated with the chart being generated.
 ScriptHandler getScriptHandler()
          Returns an instance of a transient script handler associated with the chart being generated.
 java.lang.Object getState(java.lang.Object key)
          Returns the state object from store by the key.
 IStructureDefinitionListener getStructureDefinitionListener()
          Returns an instance of the structure definition listner for device renderers that need a structure definition notification when rendering primitives.
 boolean isScriptingEnabled()
          Returns if scriting is enabled in current context.
 boolean notifyStructureChange(java.lang.String sEventName, java.lang.Object oSource)
          Notifies the structure definition listener of a change in the current running structure that defines a group of primitives being rendered and puts them into context with reference to the source object.
 void putState(java.lang.Object key, java.lang.Object state)
          Puts a state object to the store.
 java.lang.Object removeState(java.lang.Object key)
          Removes the state object by the key.
 void setActionRenderer(IActionRenderer iar)
          Sets an IActionRenderer instance to current runtime context.
 void setLocale(java.util.Locale lcl)
          Sets the locale associated with this runtime context.
 void setMessageLookup(IMessageLookup iml)
          Defines an externalized message lookup implementation per chart model being executed.
 void setResourceHandle(org.eclipse.birt.core.i18n.ResourceHandle rh)
          Specifies a resource handle that facilitates retrieval of chart specific externalized messages.
 void setScriptClassLoader(IScriptClassLoader value)
          Sets the script classLoader.
 void setScriptContext(IChartScriptContext csc)
          Sets an instance of a chart script context associated with the chart being generated.
 void setScriptHandler(ScriptHandler sh)
          Sets an instance of a transient script handler associated with the chart being generated.
 void setScriptingEnabled(boolean value)
          Sepcifies if to enable scripting in current context.
 void setStructureDefinitionListener(IStructureDefinitionListener isdl)
          Internally sets an instance of the structure definition listener for device renderers that need a structure definition notification when rendering primitives.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunTimeContext

public RunTimeContext()
A default zero-arg public constructor used for object creation.

Method Detail

putState

public final void putState(java.lang.Object key,
                           java.lang.Object state)
Puts a state object to the store.

Parameters:
key -
state -

getState

public final java.lang.Object getState(java.lang.Object key)
Returns the state object from store by the key.

Parameters:
key -
Returns:

removeState

public final java.lang.Object removeState(java.lang.Object key)
Removes the state object by the key.

Parameters:
key -
Returns:

clearState

public final void clearState()
Clears all the stored states.


isScriptingEnabled

public final boolean isScriptingEnabled()
Returns if scriting is enabled in current context.

Returns:

setScriptingEnabled

public final void setScriptingEnabled(boolean value)
Sepcifies if to enable scripting in current context.

Parameters:
value -

getScriptClassLoader

public final IScriptClassLoader getScriptClassLoader()
Returns the script classLoader if available.

Returns:

setScriptClassLoader

public final void setScriptClassLoader(IScriptClassLoader value)
Sets the script classLoader.

Parameters:
value -

setStructureDefinitionListener

public void setStructureDefinitionListener(IStructureDefinitionListener isdl)
Internally sets an instance of the structure definition listener for device renderers that need a structure definition notification when rendering primitives.

Parameters:
isdl - The structure definition listener associated with the runtime context.

getStructureDefinitionListener

public IStructureDefinitionListener getStructureDefinitionListener()
Returns an instance of the structure definition listner for device renderers that need a structure definition notification when rendering primitives.

Returns:
The structure definition listener associated with the runtime context.

setActionRenderer

public void setActionRenderer(IActionRenderer iar)
Sets an IActionRenderer instance to current runtime context.

Parameters:
iar -

getActionRenderer

public IActionRenderer getActionRenderer()
Returns the IActionRenderer of current runtime context.

Returns:

notifyStructureChange

public final boolean notifyStructureChange(java.lang.String sEventName,
                                           java.lang.Object oSource)
Notifies the structure definition listener of a change in the current running structure that defines a group of primitives being rendered and puts them into context with reference to the source object.

Parameters:
sEventName - Defines the structure being defined along with the event type
oSource - The source object on which the structure is being defined
Returns:
'true' if the structure definition listener exists and was notified of the change or 'false' otherwise.

getLocale

public final java.util.Locale getLocale()
Returns the locale associated with this runtime context.

Returns:
The locale associated with this runtime context.

setLocale

public final void setLocale(java.util.Locale lcl)
Sets the locale associated with this runtime context. This is usually done when chart generation begins.

Parameters:
lcl - The locale associated with the runtime context.

getResourceHandle

public final org.eclipse.birt.core.i18n.ResourceHandle getResourceHandle()
Returns an instance of the resource handle for which chart specific messages are externalized.

Returns:
An instance of the resource handle for which chart specific messages are externalized.

setResourceHandle

public final void setResourceHandle(org.eclipse.birt.core.i18n.ResourceHandle rh)
Specifies a resource handle that facilitates retrieval of chart specific externalized messages.

Parameters:
rh - The resource handle.

getScriptHandler

public final ScriptHandler getScriptHandler()
Returns an instance of a transient script handler associated with the chart being generated. The script handler is capable of executing callback scripts defined in the chart model.

Returns:
An instance of the script handler.

setScriptHandler

public final void setScriptHandler(ScriptHandler sh)
Sets an instance of a transient script handler associated with the chart being generated. The script handler is capable of executing callback scripts defined in the chart model.

Parameters:
sh - An instance of the script handler.

getScriptContext

public final IChartScriptContext getScriptContext()
Returns an instance of a script context associated with the chart being generated.

Returns:
An instance of the script context.

setScriptContext

public final void setScriptContext(IChartScriptContext csc)
Sets an instance of a chart script context associated with the chart being generated.

Parameters:
csc - An instance of the chart script context.

setMessageLookup

public void setMessageLookup(IMessageLookup iml)
Defines an externalized message lookup implementation per chart model being executed.

Parameters:
iml - The externalized message lookup implementation.

externalizedMessage

public final java.lang.String externalizedMessage(java.lang.String sChartKey)
A convenience method provided to lookup externalized messages associated with a given message key.

Parameters:
sChartKey - The key using which an externalized message is being looked up.
Returns:
The externalized message associated with the specified key.


Copyright © 2005 Actuate Corp. All rights reserved.