private void createActions() {
		// Debugger provides its own "Patch" actions
		patchInstructionAction = new PatchInstructionAction(this) {
			@Override
			public boolean isEnabledForContext(ActionContext context) {
				return super.isEnabledForContext(context) &&
					context instanceof ListingActionContext lac &&
					!lac.getNavigatable().isDynamic();
			}

			@Override
			public boolean isAddToPopup(ActionContext context) {
				return super.isAddToPopup(context) &&
					context instanceof ListingActionContext lac &&
					!lac.getNavigatable().isDynamic();
			}
		};
		tool.addAction(patchInstructionAction);

		patchDataAction = new PatchDataAction(this) {
			@Override
			public boolean isEnabledForContext(ActionContext context) {
				return super.isEnabledForContext(context) &&
					context instanceof ListingActionContext lac &&
					!lac.getNavigatable().isDynamic();
			}

			@Override
			public boolean isAddToPopup(ActionContext context) {
				return super.isAddToPopup(context) &&
					context instanceof ListingActionContext lac &&
					!lac.getNavigatable().isDynamic();
			}
		};
		tool.addAction(patchDataAction);
	}
A plugin for assembly

<p>
This plugin currently provides two actions: {@link PatchInstructionAction}, which allows the user
to assemble an instruction at the current address; and {@link PatchDataAction}, which allows the
user to "assemble" data at the current address.

<p>
The API for instruction assembly is available from {@link Assemblers}. For data assembly, the API
is in {@link DataType#encodeRepresentation(String, MemBuffer, Settings, int)}.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/assembler/AssemblerPlugin.java