close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2310

Table Of Contents

4.8.3 Add Command to Document View

The document view of the Site Manager is created by the class hox.corem.editor.generic.GenericDocumentView. This class builds a container for a menu bar, a tool bar and a property section which contains the data of the document. If you want to use own commands in the menu bar or tool bar of the document view you need to extend GenericDocumentView and overwrite the method getComponent which returns a JComponent. Follow the steps described in the next table.

Step

Description

1

Extend GenericDocumentView

  public class MyGenericDocumentView extends GenericDocumentVie

2

Get the standard components from the superclass

 JComponent component= super.getComponent()

3

Now you can get references on the manager components and register your command as described in Section 4.8.1, “Register Commands”

 

CommandManager commandMgr = getCommandManager();

.....

4 Return the new JComponent

return component

Table 4.8. Steps to extend GenericDocumentView.


After you are finished with your view class, you can insert it into the attribute viewClass of the element Document of the editor.xml file.

<Documents>	
	<Document type="dish" viewClass="com.custom.cap.MakeCheapClass">
	.
	.
	</Document>
</Documents>

Example 4.14. How to integrate into editor.xml


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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