@Override
	public void actionPerformed(ActionContext context) {
		if (!isEnabledForContext(context)) {
			return;
		}
		try {
			boolean isContiguousSelection = model.getSelection().getNumRanges() == 1;
			if (isContiguousSelection) {
				int index = model.getMinIndexSelected();
				if (index >= 0) {
					DataType undefinedDt =
						model.viewComposite.isPackingEnabled() ? Undefined1DataType.dataType
								: DataType.DEFAULT;
					DataTypeInstance dti =
						DataTypeInstance.getDataTypeInstance(undefinedDt, -1, false);
					model.insert(index, dti.getDataType(), dti.getLength());
				}
			}
		}
		catch (UsrException e1) {
			model.setStatus(e1.getMessage());
		}
		requestTableFocus();
	}
Action for use in the structure data type editor.
This action has help associated with it.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/InsertUndefinedAction.java