Kaydet (Commit) 6a35ea72 authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

autorecovery: more sophisticated configuration data for interaction handlers

The generic css.task.InteractionHandler implementation in module uui is now able to instantiate "sub handlers", i.e.
components to delegate a request to, based on the type of the request, and some configuration data.

The "old" (and now deprecated) configuration scheme at org.openoffice.ucb.InteractionHandler did not contain type
information, so any handlers registered there were always called when no default implementation for a given request
was available.

The "new" configuration scheme at org.openoffice.Interaction contains UNO type information. That is, a given handler
implementation can declare itself responsible for an arbitrary set of UNO types, and for each of those types, whether
it is also responsible for sub types.
The generic interaction handler implementation uses this configuration data, when it encounteres an interaction
request it cannot fullfill itself, to instantiate a component to delegate the request to.

As with the "old" data, such a component is required to support the css.task.XInteractionHandler2 interface. Also,
if it supports css.lang.XInitialization, then it will be initialized with a name-value pair, the name being
"Parent", the value being the XWindow interface of the parent window for any message boxes.

As an examplary implementation for this feature, the css.sdb.InteractionHandler has been deprecated. Now the
css.sdb.DatabaseInteractionHandler is reponsible for database-related interactions, and the new configuration scheme
is pre-filled with data assigning this responsibility.

Consequently, a lot of places previously creating an css.sdb.InteractionHandler have been modified to create the
default css.task.InteractionHandler.
üst 2d8f81af
...@@ -1084,7 +1084,7 @@ public class SpreadsheetSample : SpreadsheetDocHelper ...@@ -1084,7 +1084,7 @@ public class SpreadsheetSample : SpreadsheetDocHelper
unoidl.com.sun.star.task.XInteractionHandler xHandler = unoidl.com.sun.star.task.XInteractionHandler xHandler =
(unoidl.com.sun.star.task.XInteractionHandler) (unoidl.com.sun.star.task.XInteractionHandler)
xServiceManager.createInstance( xServiceManager.createInstance(
"com.sun.star.sdb.InteractionHandler" ); "com.sun.star.task.InteractionHandler" );
unoidl.com.sun.star.sdbcx.XTablesSupplier xSupplier = unoidl.com.sun.star.sdbcx.XTablesSupplier xSupplier =
(unoidl.com.sun.star.sdbcx.XTablesSupplier) (unoidl.com.sun.star.sdbcx.XTablesSupplier)
xSource.connectWithCompletion( xHandler ); xSource.connectWithCompletion( xHandler );
......
...@@ -118,7 +118,7 @@ class GridFieldValidator implements XUpdateListener ...@@ -118,7 +118,7 @@ class GridFieldValidator implements XUpdateListener
XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface( XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(
XInteractionHandler.class, XInteractionHandler.class,
m_xCtx.getServiceManager().createInstanceWithContext( m_xCtx.getServiceManager().createInstanceWithContext(
"com.sun.star.sdb.InteractionHandler", m_xCtx ) ); "com.sun.star.task.InteractionHandler", m_xCtx ) );
// create a new request and execute it // create a new request and execute it
InteractionRequest aRequest = new InteractionRequest( aError ); InteractionRequest aRequest = new InteractionRequest( aError );
......
...@@ -1106,7 +1106,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper ...@@ -1106,7 +1106,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
(com.sun.star.task.XInteractionHandler)UnoRuntime.queryInterface( (com.sun.star.task.XInteractionHandler)UnoRuntime.queryInterface(
com.sun.star.task.XInteractionHandler.class, com.sun.star.task.XInteractionHandler.class,
xServiceManager.createInstanceWithContext( xServiceManager.createInstanceWithContext(
"com.sun.star.sdb.InteractionHandler", getContext()) ); "com.sun.star.task.InteractionHandler", getContext()) );
com.sun.star.sdbcx.XTablesSupplier xSupplier = com.sun.star.sdbcx.XTablesSupplier xSupplier =
(com.sun.star.sdbcx.XTablesSupplier)UnoRuntime.queryInterface( (com.sun.star.sdbcx.XTablesSupplier)UnoRuntime.queryInterface(
com.sun.star.sdbcx.XTablesSupplier.class, com.sun.star.sdbcx.XTablesSupplier.class,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment