Site Manager Developer Manual / Version 2107
Table Of ContentsYou can find context menus in each view of the Site Manager. In this chapter, you will learn how to add a command to a context menu which belongs to a property editor. The steps shown in the next table will add the command to a menu belonging to a link list editor. The name of the menu is "linklist-menu" and your command will be added at the end of the menu.
Step | Description |
---|---|
1 | Extend the property editor for which you want to add your command |
public class MyLinkListEditor extends GenericLinkListEditor {
| |
2 | Overwrite the getComponent method |
public JComponent getComponent() {
| |
3 | Call the getComponent method of the parent class to create the
default behavior |
super.getComponent();
| |
4 | Get the references to the manager components and register your command as described in Section 4.8.1, “Register Commands”. |
| |
5 | Add a separator and your command to the end of the pop-up menu |
| |
6 | Return the JComponent to the Site Manager
|
|
Table 4.10. Add command to context menu