public static DataType getDataType(DecompilerActionContext context) {

		DecompilerPanel decompilerPanel = context.getDecompilerPanel();

		// prefer the selection over the current location
		ClangToken token = decompilerPanel.getSelectedToken();
		if (token == null) {
			token = context.getTokenAtCursor();
		}

		return getDataType(token);
	}
Returns the data type for the given context if the context pertains to a data type

@param context the context
@return the data type or null
Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerUtils.java