Dispatch Framework

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 18:09, 4 October 2008 by Cking (Talk | contribs)

Jump to: navigation, search



The dispatch framework is designed to provide uniform access to components for a GUI by using command URLs that mirror menu items, such as Edit - Select All, with various document components. Only the component knows how to execute a command. Similarly, different document components trigger changes in the UI by common commands. For example, a controller might create UI elements like a menu bar, or open a hyperlink.

Command dispatching follows a chain of responsibility. Calls to the dispatch API are moderated by the frame, so all dispatch API calls from the UI to the component and conversely are handled by the frame. The frame passes on the command until an object is found that can handle it. It is possible to restrict, extend or redirect commands at the frame through a different frame implementation or through other components connecting to the frame.

It has already been discussed that frames and controllers have an interface com.sun.star.frame.XDispatchProvider. The interface is used to query a dispatch object for a command URL from a frame and have the dispatch object execute the command. This interface is one element of the dispatch framework.

By offering the interception of dispatches through the interface com.sun.star.frame.XDispatchProviderInterception, the Frame service offers a method to modify a component's handling of GUI events while keeping its whole API available simultaneously.

Template:Documentation/Note

The usage of the Dispatch Framework is described in the section Using the Dispatch Framework.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools