public void setup() {
		getStyleClass().add("search-bar");

		// Remove border from search/replace text fields.
		getInputFields().forEach(field -> field.getStyleClass().addAll(Styles.ACCENT));

		// Create menu for search input left graphic (like IntelliJ) to display prior searches when clicked.
		searchInput.setLeft(oldSearches);
		getInputButtons().forEach(button -> {
			button.setDisable(true); // re-enabled when searches are populated.
			button.setGraphic(new FontIconView(CarbonIcons.SEARCH));
			button.getStyleClass().addAll(Styles.BUTTON_ICON, Styles.ACCENT, Styles.FLAT, Styles.SMALL);
		});

		// Create toggles for search input query modes.
		BoundToggleIcon toggleSensitivity = new BoundToggleIcon(new FontIconView(CarbonIcons.LETTER_CC), caseSensitivity).withTooltip("misc.casesensitive");
		BoundToggleIcon toggleRegex = new BoundToggleIcon(Icons.REGEX, regex).withTooltip("misc.regex");
		toggleSensitivity.getStyleClass().addAll(Styles.BUTTON_ICON, Styles.ACCENT, Styles.FLAT, Styles.SMALL);
		toggleRegex.getStyleClass().addAll(Styles.BUTTON_ICON, Styles.ACCENT, Styles.FLAT, Styles.SMALL);
		HBox inputToggles = new HBox(
				toggleSensitivity,
				toggleRegex
		);
		inputToggles.setAlignment(Pos.CENTER_RIGHT);
		searchInput.setRight(inputToggles);
		caseSensitivity.addListener((ob, old, cur) -> refreshResults());
		regex.addListener((ob, old, cur) -> refreshResults());

		// Create label to display number of results.
		resultCount.setMinWidth(70);
		resultCount.setAlignment(Pos.CENTER);
		resultCount.setTextAlignment(TextAlignment.CENTER);
		bindResultCountDisplay(resultCount.textProperty());
		resultCount.styleProperty().bind(hasResults.map(has -> {
			if (has) {
				return "-fx-text-fill: -color-fg-default;";
			} else {
				return "-fx-text-fill: red;";
			}
		}));

		// Add to past searches when enter is pressed.
		searchInput.setOnKeyPressed(this::onSearchInputKeyPress);
		searchInput.setOnKeyReleased(e -> refreshResults());

		// Ensure typed keys are only handled when the input is focused.
		// If the user is tab-navigating to toggle the input buttons then we want to cancel the event.
		searchInput.addEventFilter(KeyEvent.KEY_TYPED, e -> {
			if (!searchInput.isFocused() && e.getCode() != KeyCode.TAB)
				e.consume();
		});

		// When past searches list is modified, update old search menu.
		updatePastListing(oldSearches, pastSearches, searchInput);

		// Layout
		setupLayout();
	}
Initializes controls for the search bar.
recaf-ui/src/main/java/software/coley/recaf/ui/control/AbstractSearchBar.java