@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;
		}
		HighSymbol highSymbol = tokenAtCursor.getHighSymbol(context.getHighFunction());
		if (highSymbol == null || highSymbol instanceof HighFunctionShellSymbol) {
			return false;
		}
		return highSymbol.isGlobal();
	}
Action triggered from a specific token in the decompiler window to rename a global variable.
The variable is associated with an address. There may already be a symbol in the database
there, in which case the symbol is simply renamed. Otherwise a new symbol is added.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/RenameGlobalAction.java