|
Factories
GUI Commands uses factories at a number of different levels to facility easy customization of the library. These are described below. Button, Toolbar and Menu FactoriesAll commands use the factories to create their buttons and menus. This allows the library to use your own button, toolbar and menu implementations. These factories can be configured at a number of different levels.
For example, if you have your own toolbar implementation, you could create your own ToolbarFactory and call CommandManager.defaultInstance().setDefaultToolbarFactory(). The factories used by the library by default are DefaultButtonFactory, DefaultToolbarFactory and DefaultMenuFactory. GroupFactoryThe group factory allows control over the implementation of CommandGroups created by the library. This is particularly useful if you want all your groups to be capable of providing a custom widget. In such a case you'd develop your custom group implementation and then call CommandManager.defaultInstance().setGroupFactory(..) with a factory that creates it. Feel free to subcalss DefaultGroupFactory.
|