Package org.eclipse.birt.chart.factory
Class RunTimeContext
java.lang.Object
org.eclipse.birt.chart.factory.RunTimeContext
- All Implemented Interfaces:
Serializable
Encapsulates runtime information associated with each chart generation and
rendering session. It contains global objects that are defined per request.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Predifined static keys for states. -
Constructor Summary
ConstructorsConstructorDescriptionA default zero-arg public constructor used for object creation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all the stored states.void
enableNonHierarchyCategoryData
(boolean enabled) externalizedMessage
(String sChartKey) A convenience method provided to lookup externalized messages associated with a given message key.Returns the IActionRenderer of current runtime context.Returns instance of default value chart.Returns the LegendItemLayoutHints for current context.Deprecated.org.eclipse.birt.core.i18n.ResourceHandle
Returns an instance of the resource handle for which chart specific messages are externalized.Returns the script classLoader if available.Returns an instance of a script context associated with the chart being generated.Returns an instance of a transient script handler associated with the chart being generated.Returns the series renderers for current context.Returns the shared scaleReturns the state object from store by the key.<T> T
getState
(RunTimeContext.StateKey<T> key) Returns an instance of the structure definition listner for device renderers that need a structure definition notification when rendering primitives.com.ibm.icu.util.TimeZone
com.ibm.icu.util.ULocale
Returns the locale associated with this runtime context.boolean
Returns if current context is in a right-left platform.boolean
Returns true if current text reading order is Right To Leftboolean
Returns if scriting is enabled in current context.boolean
boolean
notifyStructureChange
(String sEventName, 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
Puts a state object to the store.<T> void
putState
(RunTimeContext.StateKey<T> key, T value) removeState
(Object key) Removes the state object by the key.void
Sets an IActionRenderer instance to current runtime context.void
Sets instance of default value chart.void
setExternalizer
(IExternalizer externalizer) void
Sets the LegendItemLayoutHints for current context.void
Deprecated.usesetULocale(ULocale)
instead.void
Defines an externalized message lookup implementation per chart model being executed.void
setResourceFinder
(IResourceFinder resourceFinder) void
setResourceHandle
(org.eclipse.birt.core.i18n.ResourceHandle rh) Specifies a resource handle that facilitates retrieval of chart specific externalized messages.void
setRightToLeft
(boolean value) Sets the right-left mode for current context mandatorily.void
setRightToLeftText
(boolean value) Sets the bidi text mode of the current chart object .void
Sets the script classLoader.void
Sets an instance of a chart script context associated with the chart being generated.void
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
Sets the series renderers for current context.void
setSharedScale
(SharedScaleContext ssContext) Sets the shared scalevoid
setSharingQuery
(boolean isSharingQuery) void
Internally sets an instance of the structure definition listener for device renderers that need a structure definition notification when rendering primitives.void
setTimeZone
(com.ibm.icu.util.TimeZone timeZone) void
setULocale
(com.ibm.icu.util.ULocale lcl) Sets the locale associated with this runtime context.boolean
-
Constructor Details
-
RunTimeContext
public RunTimeContext()A default zero-arg public constructor used for object creation.
-
-
Method Details
-
putState
Puts a state object to the store.- Parameters:
key
-state
-
-
getState
Returns the state object from store by the key.- Parameters:
key
-- Returns:
-
removeState
Removes the state object by the key.- Parameters:
key
-- Returns:
-
clearState
public void clearState()Clears all the stored states. -
isScriptingEnabled
public boolean isScriptingEnabled()Returns if scriting is enabled in current context.- Returns:
-
setScriptingEnabled
public void setScriptingEnabled(boolean value) Sepcifies if to enable scripting in current context.- Parameters:
value
-
-
getScriptClassLoader
Returns the script classLoader if available.- Returns:
-
setScriptClassLoader
Sets the script classLoader.- Parameters:
value
-
-
setStructureDefinitionListener
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
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
Sets an IActionRenderer instance to current runtime context.- Parameters:
iar
-
-
getActionRenderer
Returns the IActionRenderer of current runtime context.- Returns:
-
setLegendLayoutHints
Sets the LegendItemLayoutHints for current context.- Parameters:
lilh
-
-
getLegendLayoutHints
Returns the LegendItemLayoutHints for current context.- Returns:
-
setSeriesRenderers
Sets the series renderers for current context.- Parameters:
msr
-
-
getSeriesRenderers
Returns the series renderers for current context.- Returns:
-
notifyStructureChange
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 typeoSource
- 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
Deprecated.usegetULocale()
instead.Returns the locale associated with this runtime context.- Returns:
- The locale associated with this runtime context.
-
setLocale
Deprecated.usesetULocale(ULocale)
instead.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.
-
getULocale
public com.ibm.icu.util.ULocale getULocale()Returns the locale associated with this runtime context.- Returns:
- The locale associated with this runtime context.
- Since:
- 2.1
-
setULocale
public void setULocale(com.ibm.icu.util.ULocale 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.- Since:
- 2.1
-
isRightToLeft
public boolean isRightToLeft()Returns if current context is in a right-left platform. e.g. Arabic, Hebrew.- Returns:
-
setRightToLeft
public void setRightToLeft(boolean value) Sets the right-left mode for current context mandatorily.- Parameters:
value
-
-
getResourceHandle
public 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 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
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
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
Returns an instance of a script context associated with the chart being generated.- Returns:
- An instance of the script context.
-
setScriptContext
Sets an instance of a chart script context associated with the chart being generated.- Parameters:
csc
- An instance of the chart script context.
-
setMessageLookup
Defines an externalized message lookup implementation per chart model being executed.- Parameters:
iml
- The externalized message lookup implementation.
-
externalizedMessage
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.
-
isSharingQuery
public boolean isSharingQuery() -
setSharingQuery
public void setSharingQuery(boolean isSharingQuery) -
isRightToLeftText
public boolean isRightToLeftText()Returns true if current text reading order is Right To Left- Returns:
-
setRightToLeftText
public void setRightToLeftText(boolean value) Sets the bidi text mode of the current chart object .- Parameters:
value
-
-
getResourceFinder
- Returns:
- Returns the resourceFinder.
-
setResourceFinder
- Parameters:
resourceFinder
- The resourceFinder to set.
-
getExternalizer
- Returns:
- Returns the externalizer.
-
setExternalizer
- Parameters:
externalizer
- The externalizer to set.
-
getState
-
putState
-
setDefaultValueChart
Sets instance of default value chart.- Parameters:
cm
-
-
getDefaultValueChart
Returns instance of default value chart.- Returns:
- instance of default value chart.
-
getTimeZone
public com.ibm.icu.util.TimeZone getTimeZone()- Returns:
- Returns the timeZone.
-
setTimeZone
public void setTimeZone(com.ibm.icu.util.TimeZone timeZone) - Parameters:
timeZone
- The timeZone to set.
-
enableNonHierarchyCategoryData
public void enableNonHierarchyCategoryData(boolean enabled) -
useNonHierarchyCategoryData
public boolean useNonHierarchyCategoryData()
-
getULocale()
instead.