- Description
- dispatches (executes) a URL
It is only allowed to dispatch URLs for which this XDispatch
was explicitly queried. Additional arguments ("'#..." or "?...") are allowed.
- Parameter URL
- fully parsed URL describing the feature which should be dispatched (=executed)
- Parameter Arguments
- optional arguments for this request
(see com::sun::star::document::MediaDescriptor)
They depend on the real implementation of the dispatch object.
Controlling synchronous or asynchronous mode happens via
readonly boolean Flag SynchronMode
By default, and absent any arguments, "SynchronMode" is
considered `FALSE` and the execution is performed
asynchronously (i.e. dispatch() returns immediately, and
the action is performed in the background). But when set
to `TRUE`, dispatch() processes the request synchronously
- this call will block until it has finished.
some code for a click-handler (Java)
@code{.java}
void myOnClick(String sURL,String sTargetFrame,
com.sun.star.beans.PropertyValue[] lArguments)
{
com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
aURL[0] = new com.sun.star.util.URL();
aURL[0].Complete = sURL;
com.sun.star.util.XURLTransformer xParser =
(com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
com.sun.star.util.XURLTransformer.class,
mxServiceManager.createInstance("com.sun.star.util.URLTransformer"));
xParser.parseStrict(aURL);
com.sun.star.frame.XDispatch xDispatcher =
mxFrame.queryDispatch(aURL[0], sTargetFrame, com.sun.star.frame.FrameSearchFlag.GLOBAL);
if(xDispatcher!=null)
xDispatcher.dispatch(aURL[0], lArguments);
}
@endcode
|