I read about org.eclipse.e4.core.contexts.IContextFunction
but could not find online an actual example.
My understanding is that a component implements an IContextFunction
and on calling compute
another object is lazily created.
But how/when the compute
method is called it is not clear to me.
For example with the following:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
name="com.example.e4.rcp.todo.contextservice.translate">
<implementation class="com.example.e4.rcp.todo.contextservice.Test"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<property name="service.context.key" type="String"
value="com.example.e4.rcp.todo.contextservice.test"/>
</scr:component>
someone must call for the com.example.e4.rcp.todo.contextservice.test
for compute
to be called but it is unclear to me how this is used.
Does anyone have an example reference?