On 19 December 2012 10:36,
<say...@birzeit.edu> wrote:
but what about inlineTypes with no dialog .. how can implement it?
Thats pretty straightforward .
You define the inlinetype as before .. in the configuration.
But in the action configuration, you specify a customer router and dont indicate a dialog e.g. :
<action name="make_simple_inline" source="inlineType" metadata="SimpleInline" >
<router class="org.bungeni.editor.actions.routers.routerCreateSimpleInline" />
</action>
THen you just create a router implementation class :
org.bungeni.editor.actions.routers.routerCreateSimpleInline
and override the route_TextSelectedInsert() API --
where you will have to do something like :
//build the map of properties to set on the inline
HashMap<String,String> inlinePropsMap = new HashMap<String,String>();
//this is mandatory to identify the inline type
inlinePropsMap.put("BungeniInlineType", subAction.getInlineType());
//these are optional custom properties like the refURI ..
inlinePropsMap.put("BungeniSimpleInlineMeta", "Something");
//set the metadata on the selected text
ooDocument.setSelectedTextAttributes(inlinePropsMap);