private void truncateHistoryAsNeeded() {
		Options opt = plugin.getTool().getOptions(ToolConstants.TOOL_OPTIONS);
		int maxEntries =
			opt.getInt(GhidraOptions.OPTION_MAX_GO_TO_ENTRIES, DEFAULT_MAX_GOTO_ENTRIES);
		int historySize = history.size();

		if (historySize > maxEntries) {
			int numToRemove = historySize - maxEntries;

			for (int i = 0; i < numToRemove; i++) {
				history.remove(history.size() - 1);
			}
		}
	}
Builds the main panel for this dialog.
@return the main panel for this dialog
Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/GoToAddressLabelDialog.java