public void moveDirectory(@Nonnull Workspace workspace,
	                          @Nonnull WorkspaceResource resource,
	                          @Nonnull FileBundle bundle,
	                          @Nonnull String directoryName) {
		boolean isRootDirectory = directoryName.isEmpty();
		String localDirectoryName = shortenPath(directoryName);
		ItemTreeSelectionPopup.forDirectoryNames(bundle, chosenDirectories -> {
					if (chosenDirectories.isEmpty()) return;
					String newDirectoryName = chosenDirectories.get(0);
					if (directoryName.equals(newDirectoryName)) return;

					String prefix = directoryName + "/";
					for (FileInfo value : bundle.valuesAsCopy()) {
						String filePath = value.getName();
						String fileName = shortenPath(filePath);

						// Source is root directory, this file is also in the root directory
						if (isRootDirectory && filePath.indexOf('/') == -1) {
							String name = newDirectoryName + "/" + fileName;
							bundle.remove(filePath);
							bundle.put(value.toFileBuilder().withName(name).build());
						} else {
							// Source is another package, this file matches that package
							if (filePath.startsWith(prefix)) {
								String name;
								if (newDirectoryName.isEmpty()) {
									// Target is root directory
									name = localDirectoryName + "/" + fileName;
								} else if (filePath.startsWith(directoryName)) {
									// Target is another directory
									name = replacePrefix(filePath, directoryName, newDirectoryName + "/" + localDirectoryName);
								} else {
									continue;
								}
								bundle.remove(filePath);
								bundle.put(value.toFileBuilder().withName(name).build());
							}
						}
					}
				}).withTitle(Lang.getBinding("dialog.title.move-directory"))
				.withTextMapping(name -> textService.getDirectoryTextProvider(workspace, resource, bundle, name).makeText())
				.withGraphicMapping(name -> iconService.getDirectoryIconProvider(workspace, resource, bundle, name).makeIcon())
				.show();
	}
Prompts the user to select a directory to move the given directory into.

@param workspace
		Containing workspace.
@param resource
		Containing resource.
@param bundle
		Containing bundle.
@param directoryName
		Directory to go move into another directory as a sub-directory.
recaf-ui/src/main/java/software/coley/recaf/services/navigation/Actions.java