@Override
	protected boolean isEnabledForDecompilerContext(DecompilerActionContext context) {
		Function function = context.getFunction();
		if (function == null || function instanceof UndefinedFunction) {
			return false;
		}

		ClangToken tokenAtCursor = context.getTokenAtCursor();
		if (tokenAtCursor == null) {
			return false;
		}
		if (tokenAtCursor instanceof ClangFieldToken) {
			return false;
		}
		if (tokenAtCursor.Parent() instanceof ClangReturnType) {
			return false;
		}
		if (!tokenAtCursor.isVariableRef()) {
			return false;
		}
		HighSymbol highSymbol = tokenAtCursor.getHighSymbol(context.getHighFunction());
		if (highSymbol == null) {
			return false;
		}
		return highSymbol.isGlobal();
	}
Action triggered from a specific token in the decompiler window to change the data-type
associated with a global variable. If the variable does not already exist in the program database,
it will be created using storage address the decompiler has assigned to the variable within its model.
In either case, there is a preexisting notion of variable storage. This action may allow the newly
selected data-type to be of a different size relative to this preexisting storage, constrained by
other global variables that might already consume storage.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RetypeGlobalAction.java