private void editField(ListingActionContext context) {

		Program program = context.getProgram();
		ProgramLocation location = context.getLocation();
		Address address = location.getAddress();
		int[] path = location.getComponentPath();

		DataTypeComponent dtc = DataTypeUtils.getDataTypeComponent(program, address, path);
		DataType parent = dtc.getParent();
		Composite composite = (Composite) parent;
		int ordinal = dtc.getOrdinal();
		EditDataFieldDialog dialog =
			new EditDataFieldDialog(tool, dtmService, composite, program, address, ordinal);
		tool.showDialog(dialog);
	}
Callback for edit data type action
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/DataPlugin.java