@Override
	public void actionPerformed(ProgramActionContext context) {

		Function function = null;
		if (context instanceof ListingActionContext) {
			ListingActionContext listingContext = (ListingActionContext) context;
			ProgramLocation loc = listingContext.getLocation();
			if (loc instanceof FunctionLocation) {
				function = functionPlugin.getFunction(listingContext);
			}
			else if (loc instanceof OperandFieldLocation) {
				function = functionPlugin.getFunctionInOperandField(context.getProgram(),
					(OperandFieldLocation) loc);
			}
		}
		else {
			ProgramSymbolActionContext symbolContext = (ProgramSymbolActionContext) context;
			Symbol symbol = symbolContext.getFirstSymbol();
			if (symbol == null) {
				return; // assume symbol removed
			}
			function = (Function) symbol.getObject();
		}
		if (function != null) {
			PluginTool tool = functionPlugin.getTool();
			DataTypeManagerService service = tool.getService(DataTypeManagerService.class);
			FunctionEditorDialog dialog = new FunctionEditorDialog(service, function);
			tool.showDialog(dialog, context.getComponentProvider());
		}
	}
Method called when the action is invoked.
@param ev details regarding the invocation of this action
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditFunctionAction.java