@Nonnull
	private Node createPreviewDisplay(@Nonnull Instance<SearchBar> searchBarProvider) {
		// Editor to preview the current mappings
		Editor editor = new Editor();
		editor.setText("# A preview of your mappings will appear here once generated");
		editor.getStylesheets().add(LanguageStylesheets.getEnigmaStylesheet());
		editor.setSyntaxHighlighter(new RegexSyntaxHighlighter(RegexLanguages.getLangEngimaMap()));
		editor.getCodeArea().setEditable(false);
		editor.disableProperty().bind(mappingsToApply.isNull());
		editor.getStyleClass().add(Styles.BORDER_DEFAULT);
		searchBarProvider.get().install(editor);

		// Label describing how much of the workspace will be updated by the current mappings.
		Label stats = new Label();
		stats.textProperty().bind(Lang.getBinding("mapgen.preview.empty"));
		mappingsToApply.addListener((ob, old, cur) -> {
			if (stats.textProperty().isBound()) stats.textProperty().unbind();
			if (cur == null) {
				// Shouldn't happen, but here just in case
				FxThreadUtil.run(() -> {
					stats.textProperty().bind(Lang.getBinding("mapgen.preview.empty"));
					editor.setText("# Nothing");
				});
			} else {
				// Update stats
				IntermediateMappings mappings = cur.exportIntermediate();
				int classes = mappings.getClasses().size();
				int fields = mappings.getFields().values().stream().mapToInt(List::size).sum();
				int methods = mappings.getMethods().values().stream().mapToInt(List::size).sum();
				int variables = mappings.getVariables().values().stream().mapToInt(List::size).sum();
				String formatted = """
						Mappings will rename:
						 - %d classes
						 - %d fields
						 - %d methods
						 - %d variables
						""".formatted(classes, fields, methods, variables);
				stats.setText(formatted);

				// Also update editor preview
				String mappingText = new EnigmaMappings().exportText(mappings).replace("\0", "");
				FxThreadUtil.run(() -> editor.setText(mappingText));
			}
		});

		// Buttons to generate/apply mappings
		Button configureGenerator = new ActionButton(new FontIconView(CarbonIcons.SETTINGS, 20), this::configureGenerator);
		Button generateButton = new ActionButton(Lang.getBinding("mapgen.generate"), this::generate);
		Button applyButton = new ActionButton(Lang.getBinding("mapgen.apply"), this::apply);
		List<String> providerIds = nameGeneratorProviders.getProviders().keySet().stream().sorted().collect(Collectors.toList());
		BoundComboBox<String> generatorCombo = new BoundComboBox<>(currentProvider, providerIds, new StringConverter<>() {
			@Override
			public String toString(String s) {
				return StringUtil.uppercaseFirstChar(s).replace('-', ' ');
			}

			@Override
			public String fromString(String s) {
				return s;
			}
		});
		generatorCombo.getStyleClass().add("dark-combo-box");
		generateButton.setMaxWidth(Double.MAX_VALUE);
		applyButton.setMaxWidth(Double.MAX_VALUE);
		HBox.setHgrow(applyButton, Priority.ALWAYS);
		applyButton.disableProperty().bind(mappingsToApply.isNull());

		// Layout
		InputGroup inputGroup = new InputGroup(configureGenerator, generateButton, generatorCombo);
		HBox.setHgrow(generateButton, Priority.ALWAYS);
		HBox.setHgrow(inputGroup, Priority.ALWAYS);
		HBox buttons = new HBox(inputGroup, applyButton);
		buttons.setSpacing(10);
		VBox layout = new VBox(editor, stats, buttons);
		VBox.setVgrow(editor, Priority.ALWAYS);
		layout.setSpacing(10);
		return layout;
	}
Generates the mappings for the current settings. The result is displayed in the {@link #previewGroup}.
recaf-ui/src/main/java/software/coley/recaf/ui/pane/MappingGeneratorPane.java