private boolean gatherVersionedFiles(TaskMonitor monitor, List<DomainFile> results)
				throws CancelledException {

			monitor.setMessage("Examining Files...");
			monitor.setMaximum(files.size());

			for (DomainFile df : files) {
				monitor.checkCancelled();

				if (df.isVersioned() && !df.isCheckedOut()) {
					results.add(df);
				}
				monitor.incrementProgress(1);
			}

			int n = results.size();
			if (n == 0) {
				Msg.showError(this, tool.getToolFrame(), "Checkout Failed",
					"The specified files do not contain any versioned files available for " +
						"checkout");
				return false;
			}

			//
			// Confirm checkout - prompt for exclusive checkout, if possible.  Otherwise, only
			//                    confirm a bulk checkout.
			//

			// note: a 'null' user means that we are using a local repository
			User user = getUser();
			if (user != null && user.hasWritePermission()) {

				checkout = Swing.runNow(() -> new CheckoutDialog());

				if (checkout.showDialog(tool) != CheckoutDialog.OK) {
					return false;
				}
				exclusive = checkout.exclusiveCheckout();
				return true;
			}

			if (n == 1) {
				return true; // single file; no prompt needed
			}

			// more than one file
			int choice = OptionDialog.showYesNoDialogWithNoAsDefaultButton(tool.getToolFrame(),
				"Confirm Bulk Checkout",
				"Would you like to checkout " + results.size() + " files as specified?");
			return choice == OptionDialog.YES_OPTION;
		}
Task for checking out files that are in version control
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/VersionControlCheckOutAction.java