{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Customizing Menu Items In Nodes","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":"customizing-menu-items-in-nodes","__idx":0},"children":["Customizing Menu Items In Nodes"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-nodes","__idx":1},"children":["Data Nodes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Data nodes are displayed in the \"Data\" top component accessible from the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Window"]}," -> ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data"]}," menu item."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add an action to a node displayed in the \"Data\" or \"File Explorer\" top components, extend the com.interactive.intviewerapi.data.AbstractDataNodeAction class."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ATTACHDEVIATIONTOWELLDATAACTION.JAVA"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"package com.interactive.intviewer.well.data.action;\nimport com.interactive.intviewer.util.LayerPropertiesUtil;\nimport com.interactive.intviewer.well.data.editor.AttachDeviationFileEditor;\nimport com.interactive.intviewerapi.data.AbstractDataNodeAction;\nimport com.interactive.intviewerapi.data.IData;\nimport com.interactive.intviewerapi.data.well.ITrajectoryReader;\nimport com.interactive.intviewerapi.data.well.IWellData;\nimport java.util.logging.Logger;\nimport javax.swing.Action;\npublic class AttachDeviationToWellDataAction extends AbstractDataNodeAction {\n    private static final Logger logger = Logger.getLogger(AttachDeviationToWellDataAction.class.getName());\n    public AttachDeviationToWellDataAction() {\n        super(\"Attach Deviation File ...\");\n    }\n    @Override\n    public Action toAction(Object object, int x, int y) {\n        if (object == null || !(object instanceof IWellData)) {\n            return null;\n        }\n        IWellData wellData = (IWellData) object;\n        if (wellData.getTrajectory() != null) {\n            ITrajectoryReader reader = wellData.getTrajectory().select();\n            if (reader.getNumberOfValues() != 0) {\n                return null;\n            }\n        }\n        return super.toAction(object, x, y);\n    }\n    @Override\n    protected void performAction(IData object, int x, int y) {\n        LayerPropertiesUtil.openSinglePropertiesDialog(false, new AttachDeviationFileEditor((IWellData) object), null);\n    }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then register this action in the layer.xml file:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["LAYER.XML"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"    <folder name=\"DataNodeActions\">\n        <folder name=\"WellData\">\n            <file name=\"com.interactive.intviewer.well.data.action.AttachDeviationToWellDataAction.instance\">\n                <attr name=\"position\" intvalue=\"400\"/>\n            </file>\n        </folder>\n    </folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"window-nodes","__idx":2},"children":["Window Nodes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Window nodes are displayed in the \"Layers\" top component accessible from the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Window"]}," -> ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Layers"]}," menu item."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add an action to a window node displayed in the \"Layers\" top component, extend the com.interactive.intviewerapi.data.AbstractViewerWindowNodeAction class."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CLOSEVIEWERWINDOWACTION.JAVA"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"package com.interactive.intviewer.view2d.actions;\nimport com.interactive.intviewerapi.windows.AbstractViewerWindow;\nimport com.interactive.intviewerapi.windows.AbstractViewerWindowNodeAction;\nimport com.interactive.intviewerapi.windows.IViewerWindow;\nimport java.util.logging.Logger;\nimport javax.swing.Action;\npublic class CloseViewerWindowAction extends AbstractViewerWindowNodeAction{\n    private static final Logger _logger = Logger.getLogger(CloseViewerWindowAction.class.getName());\n    public CloseViewerWindowAction() {\n        super(\"Close Window\");\n    }\n    @Override\n    public Action toAction(Object object, int x, int y) {\n        IViewerWindow viewerWindow = (IViewerWindow) object;\n        if (!(viewerWindow instanceof AbstractViewerWindow)) {\n            return null;\n        }\n        return super.toAction(object, x, y);\n    }\n    @Override\n    protected void performAction(IViewerWindow object, int x, int y) {\n        CloseWindowAction.closeViewerWindow((AbstractViewerWindow) object);\n    }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then register this action in the layer.xml file:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["LAYER.XML"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"    <folder name=\"ViewerWindowNodeActions\">\n        <folder name=\"XSectionLayeredWindow\">\n            <file name=\"com-interactive-intviewer-view2d-actions-CloseViewerWindowAction.instance\">\n                <attr name=\"position\" intvalue=\"700\"/>\n            </file>\n        </folder>\n    </folder>\n","lang":"xml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"visual-nodes","__idx":3},"children":["Visual Nodes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Visual nodes are displayed in the \"Layers\" top component accessible from the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Window"]}," -> ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Layers"]}," menu item."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add an action to a visual node displayed in the \"Layers\" top component, extend the com.interactive.intviewerapi.data.AbstractVisualNodeAction class."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MOVETOPVISUALACTION.JAVA"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"package com.interactive.intviewer.control;\nimport com.interactive.intviewerapi.AbstractVisualNodeAction;\nimport com.interactive.intviewerapi.IMovableVisual;\nimport com.interactive.intviewerapi.IVisual;\nimport javax.swing.Action;\npublic class MoveTopVisualAction extends AbstractVisualNodeAction {\n    public MoveTopVisualAction() {\n        super(\"Move to Top\");\n    }\n    @Override\n    public Action toAction(final Object object, final int x, final int y) {\n        if (!(object instanceof IMovableVisual)) {\n           return null; \n        }\n        return super.toAction(object, x, y);\n    }\n    @Override\n    protected void performAction(IVisual object, int x, int y) {\n        ((IMovableVisual) object).moveToTop();\n    }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then register this action in the layer.xml file:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["LAYER.XML"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"    <folder name=\"VisualNodeActions\">\n        <folder name=\"ViewerSeismicLayer\">\n            <file name=\"com-interactive-intviewer-control-MoveTopVisualAction.instance\">\n                <attr name=\"position\" intvalue=\"700\"/>\n            </file>\n        </folder>\n    </folder>\n","lang":"xml"},"children":[]}]},"headings":[{"value":"Customizing Menu Items In Nodes","id":"customizing-menu-items-in-nodes","depth":1},{"value":"Data Nodes","id":"data-nodes","depth":3},{"value":"Window Nodes","id":"window-nodes","depth":3},{"value":"Visual Nodes","id":"visual-nodes","depth":3}],"frontmatter":{"title":"Customizing Menu Items In Nodes","pageId":"intviewer-apis-for-the-intviewer-desktop/customizing-menu-items-in-nodes","seo":{"title":"Customizing Menu Items In Nodes"}},"lastModified":"2026-10-22T14:32:05.576Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-apis-for-the-intviewer-desktop/customizing-menu-items-in-nodes","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}