{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Layer Right Click Popup Menus","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"layer-right-click-popup-menus","__idx":0},"children":["Layer Right Click Popup Menus"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/intviewer/intviewer-tutorial/using-intviewer-components-walkthroughs/adding-a-contextual-menu-item-to-a-layer-visualization-walkthrough"},"children":["walkthrough"]}," is available to show how to implement contextual menus with layers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"customize-layer-popup-actions","__idx":1},"children":["Customize Layer Popup Actions"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-custom-actions","__idx":2},"children":["Create Custom Actions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Actions of type java.swing.Action or com.interactive.intviewerapi.layers.actions.LayerAction can be added to the popup menu. Implementations of com.interactive.intviewerapi.layers.actions.LayerAction will be provided the layer and point where the user clicked."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"public class CustomLayerAction extends AbstractLayerAction {\n    public CustomLayerAction() {\n         super(\"Custom Action\");\n    }\n  @Override\n  public void performAction(ILayer2D layer, int x, int y) {\n    // do stuff here\n  }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"layer-lookup","__idx":3},"children":["Layer Lookup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Layers are names are resolved using the ILayer2D.getType method. The default implementation of this method returns the simple name of the implementation class."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"add-action-to-layer","__idx":4},"children":["Add action to layer"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add an action to a layer type name and the full path to the action class should be specified in the layer.xml of the plugin."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a Seismic layer in a XSection window (ISeismicLayer in IXSectionWindow)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<folder name=\"LayerActions\">\n  <folder name=\"ViewerSeismicLayer\">\n    <file name=\"org-yourpackage-CustomLayerAction.instance\">\n      <attr name=\"position\" intvalue=\"150\"/>\n    </file>\n  </folder>\n</folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a Horizon layer in a XSection window (IHorizonLayer in IXSectionWindow)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<folder name=\"LayerActions\">\n  <folder name=\"ViewerHorizonLayer\">\n    <file name=\"org-yourpackage-CustomLayerAction.instance\">\n      <attr name=\"position\" intvalue=\"150\"/>\n    </file>\n  </folder>\n</folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"remove-action-from-layer","__idx":5},"children":["Remove action from layer"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the _hidden extension to remove an action from a layer popup menu."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<folder name=\"LayerActions\">\n  <folder name=\"ViewerMapHorizonLayer\">\n    <file name=\"com-interactive-intviewer-control-BroadcastSelectedPointAction.instance_hidden\">\n      <attr name=\"position\" intvalue=\"150\"/>\n    </file>\n  </folder>\n</folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"separator","__idx":6},"children":["Separator"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is also possible to add a bit of organization to the popup menu by adding separators."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<folder name=\"LayerActions\">\n  <folder name=\"ViewerMapHorizonLayer\">\n    <file name=\"com-interactive-intviewer-control-LayerEditorAction.instance\">\n      <attr name=\"position\" intvalue=\"100\"/>\n    </file>\n    <file name=\"com-interactive-intviewer-control-BroadcastSelectedPointAction.instance\">\n      <attr name=\"position\" intvalue=\"110\"/>\n    </file>\n    <file name=\"Separator1.instance\">\n      <attr name=\"position\" intvalue=\"120\"/>\n      <attr name=\"instanceClass\" stringvalue=\"javax.swing.JSeparator\"/>\n    </file>\n    <file name=\"org-yourpackage-CustomLayerAction.instance\">\n      <attr name=\"position\" intvalue=\"150\"/>\n    </file>\n  </folder>\n</folder>\n","lang":"xml"},"children":[]}]},"headings":[{"value":"Layer Right Click Popup Menus","id":"layer-right-click-popup-menus","depth":1},{"value":"Customize Layer Popup Actions","id":"customize-layer-popup-actions","depth":2},{"value":"Create Custom Actions","id":"create-custom-actions","depth":3},{"value":"Layer Lookup","id":"layer-lookup","depth":3},{"value":"Add action to layer","id":"add-action-to-layer","depth":3},{"value":"Remove action from layer","id":"remove-action-from-layer","depth":3},{"value":"Separator","id":"separator","depth":3}],"frontmatter":{"title":"Layer Right Click Popup Menus","pageId":"intviewer-api-for-layers/layer-right-click-popup-menus","seo":{"title":"Layer Right Click Popup Menus"}},"lastModified":"2026-10-22T14:32:05.573Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-api-for-layers/layer-right-click-popup-menus","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}