close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2307

Table Of Contents

4.8.4 Add Command to Explorer View

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.
 

return this;

}

Table 4.9. How to integrate your command into the explorer view


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.