@Override
		public void keyPressed(KeyEvent e) {
			if (e.isConsumed()) {
				return;
			}
			switch (e.getKeyCode()) {
				case KeyEvent.VK_ESCAPE:
					cancel();
					e.consume();
					break;
				case KeyEvent.VK_ENTER:
					accept();
					e.consume();
					break;
			}
		}
An abstract action for patching

<p>
This handles most of the field placement, but relies on quite a few callbacks.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AbstractPatchAction.java