@Override
	public ActionContext getActionContext(MouseEvent event) {
		GTreeNode clickedNode = null;
		boolean isToolbarAction = true;
		if (event != null) {
			Object source = event.getSource();
			if (source instanceof JTextField || source instanceof JTextPane) {
				Component component = (Component) source;
				return new DefaultActionContext(this, source, component);
			}

			Point point = event.getPoint();
			clickedNode = archiveGTree.getNodeForLocation(point.x, point.y);
			isToolbarAction = false;
		}
		else {
			// Called via a keybinding; use the selected node in the tree to represent the clicked
			// node.  This allows users to use a keybinding to show the context menu and have all
			// actions installed.
			TreePath path = archiveGTree.getSelectionPath();
			if (path != null) {
				clickedNode = (GTreeNode) path.getLastPathComponent();
			}
		}

		return new DataTypesActionContext(this, plugin.getProgram(), archiveGTree, clickedNode,
			isToolbarAction);
	}
This creates all the actions for opening/creating data type archives.
It also creates the action for refreshing the built-in data types
from the class path.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypesProvider.java