@Override
	public boolean isEnabledForContext(ActionContext context) {
		if (!(context instanceof DualDecompilerActionContext compareContext)) {
			return false;
		}
		DecompilerCodeComparisonPanel decompPanel = compareContext.getCodeComparisonPanel();

		if (disableOnReadOnly) {
			//get the program corresponding to the panel with focus
			Side focusedSide = decompPanel.getActiveSide();
			Program program = decompPanel.getProgram(focusedSide);
			if (program == null) {
				return false; //panel initializing; don't enable action
			}
			if (!program.canSave()) {
				return false;  //program is read-only, don't enable action
			}
		}

		TokenPair currentPair = getCurrentTokenPair(decompPanel);
		return enabledForTokens(currentPair);

	}
Determines whether the action should be enable for a pair of
matching tokens. 

@param tokenPair tokens
@return true if action should be enabled
Ghidra/Features/CodeCompare/src/main/java/ghidra/features/codecompare/decompile/AbstractMatchedTokensAction.java