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

		int row = indices[0];
		int min = 1;
		int max = model.getMaxDuplicates(row);
		if (max == 0) {
			return;
		}

		int initial = model.getLastNumDuplicates();
		NumberInputDialog numberInputDialog =
			new NumberInputDialog("duplicates", ((initial > 0) ? initial : 1), min, max);
		String helpAnchor = provider.getHelpName() + "_" + "Duplicates_NumberInputDialog";
		HelpLocation helpLoc = new HelpLocation(provider.getHelpTopic(), helpAnchor);
		numberInputDialog.setHelpLocation(helpLoc);

		if (numberInputDialog.show()) {
			int count = numberInputDialog.getValue();
			TaskLauncher.launchModal("Duplicating Component",
				monitor -> doInsert(row, count, monitor));
		}

		requestTableFocus();
	}
Action that allows the user to make multiple duplicates of the selected item
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DuplicateMultipleAction.java