DataType getSelectedDataType(DataTypesActionContext context) {
		Object contextObject = context.getContextObject();
		GTree gtree = (GTree) contextObject;
		TreePath[] selectionPaths = gtree.getSelectionPaths();
		if (selectionPaths == null || selectionPaths.length != 1) {
			return null;
		}
		DataTypeTreeNode node = (DataTypeTreeNode) selectionPaths[0].getLastPathComponent();
		if (!(node instanceof DataTypeNode)) {
			return null;
		}
		DataTypeNode dataTypeNode = (DataTypeNode) node;
		DataType dataType = dataTypeNode.getDataType();
		if (dataType.getDataTypeManager() instanceof DataTypeManagerDB) {
			return dataType;
		}
		return null;
	}
Update the Favorites actions for favorite data types.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/DataPlugin.java