Site Manager Developer Manual / Version 2304
Table Of Contents
If you want to use own commands in the menu bar or tool bar of the explorer view you simply need to extend the
ExplorerView
class and add it to the editor using the attribute explorerViewClass
of
the FrameFactory
element. Follow the steps described in the next table.
Step | Description |
---|---|
1. | Extend ExplorerView. |
public class MyExplorerView extends ExplorerView
| |
2. | Overwrite the getComponent method. |
public JComponent getComponent() {
| |
3. | Get references to the CommandManager the ListenerManager and/or the ToolBarManager and/or the MenuBarManager. |
CommandManager commandMgr = getCommandManager(); ListenerManager listenerMgr =
getListenerManager(); ToolBarManager toolBarMgr = getToolBarManager();
MenuBarManager menuBarMgr = getMenuBarManager();
| |
4. | Now you can get references on the manager components and register your command as described in Section 4.8.1, “Register Commands”. |
commandMgr.registerCommand("makecheaper", new
com.coremedia.extensions.MyFirstCommand); ...
| |
5. | Call the super method getComponent() . It's important to call this
method after you have associated the command with
an activation model. |
super.getComponent()
| |
6. | Return the ExplorerView . |
|
Table 4.9. How to integrate your command into the explorer view