A contextual menu is a menu displayed when right-clicking an object. Layers have various contextual menu items. In this example, we will add a menu item in the contextual menu of a seismic layer. The action associated with this menu item will be a warning dialog box showing the current coordinates within that layer.
Reviewing Dependencies
The creation of a menu item requires two INT modules that are part of the INTViewer platform:
See the list of INTViewer modules to load the INTViewer platform and for a description of each module.
This requires the import of com.interactive.intviewerapi.util.DialogManager. More details about dialog boxes are available.
You can download the DemoLayerContextualMenuItemAction.java file from the attachments at the bottom this page.
Modify the layer.xml file as follow:
In this layer.xml file:
You can download the layer.xml file from the attachments at the bottom this page. See layer actions in the references for a list of available layer types
More information about contextual menus and layers is available in the references.