Object (@NotNull String dataId) { if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } if (LangDataKeys.MODULE_CONTEXT.is(dataId)) { TreePath selectionPath = myTree.getLeadSelectionPath(); if (selectionPath != null && selectionPath.getLastPathComponent() instanceof DefaultMutableTreeNode node) { if (node.getUserObject() instanceof MyUserObject) { return ((MyUserObject)node.getUserObject()).myModule; } } } if (PlatformCoreDataKeys.HELP_ID.is(dataId)) { return HELP_ID; } if (CommonDataKeys.NAVIGATABLE.is(dataId)) { TreePath selectionPath = myTree.getLeadSelectionPath(); if (selectionPath != null && selectionPath.getLastPathComponent() instanceof DefaultMutableTreeNode node) { if (node.getUserObject() instanceof MyUserObject) { return node.getUserObject(); } } } return null; }