@Override
	public void actionPerformed(ActionContext context) {
		if (!isEnabledForContext(context)) {
			return;
		}
		int[] indices = model.getSelectedComponentRows();
		if (indices.length != 1) {
			return;
		}

		int max = model.getMaxDuplicates(indices[0]);
		if (max != 0) {
			try {
				// note: only duplicating one item; no need for a task
				model.duplicateMultiple(indices[0], 1, TaskMonitor.DUMMY);
			}
			catch (UsrException e1) {
				model.setStatus(e1.getMessage(), true);
			}
		}
		requestTableFocus();
	}
Action to duplicate the selected row
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DuplicateAction.java