@Override
	public void actionPerformed(ListingActionContext context) {
		final Program program = context.getProgram();
		final Address address = context.getAddress();
		Instruction instr = program.getListing().getInstructionAt(address);
		int oldStackDepthChange = 0;
		final Address callToAddress = getFunctionCallAddress(instr);

		//Get the old stack depth change if it is set.
		Integer change = CallDepthChangeInfo.getStackDepthChange(program, address);
		if (change != null) {
			oldStackDepthChange = change;
		}
		else {
			FunctionManager functionMgr = program.getFunctionManager();
			Function toFunction =
				(callToAddress != null) ? functionMgr.getFunctionAt(callToAddress) : null;
			Function func = functionMgr.getFunctionContaining(address);
			if (toFunction != null) {
				oldStackDepthChange = -(toFunction.getStackPurgeSize());
			}
			else if (func != null) {
				CallDepthChangeInfo callInfo = new CallDepthChangeInfo(func);
				if (instr != null) {
					oldStackDepthChange = callInfo.getInstructionStackDepthChange(instr);
					if (oldStackDepthChange == Function.UNKNOWN_STACK_DEPTH_CHANGE) {
						oldStackDepthChange = 0;
					}
				}
			}
		}

		// Display the dialog.
		String title = "Set Stack Depth Change at " + address.toString();
		NumberInputDialog dialog = new NumberInputDialog(title, "Stack Depth Change",
			oldStackDepthChange, Integer.MIN_VALUE, Integer.MAX_VALUE, false);

		if (!dialog.show()) {
			return;
		}
		int stackDepthChange = dialog.getValue();

		setStackDepthChange(program, address, stackDepthChange, callToAddress);
	}
Creates a new action with the given name and associated to the given
plugin.
@param plugin the plugin this action is associated with.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/SetStackDepthChangeAction.java