boolean checkRepositoryConnected(PluginTool tool) {
		RepositoryAdapter repository = tool.getProject().getRepository();
		if (repository == null) {
			return true;
		}

		if (repository.verifyConnection()) {
			return true;
		}

		if (OptionDialog.showYesNoDialog(tool.getToolFrame(), "Lost Connection to Server",
			"The connection to the Ghidra Server has been lost.\n" +
				"Do you want to reconnect now?") == OptionDialog.OPTION_ONE) {
			try {
				repository.connect();
				return true;
			}
			catch (NotConnectedException e) {
				// message displayed by repository server adapter
				return false;
			}
			catch (IOException e) {
				ClientUtil.handleException(repository, e, "Repository Connection",
					tool.getToolFrame());
				return false;
			}
		}

		return false;
	}
NOTE: do not call this from a non-Swing thread

@param tool the tool
@return true if the repository is null or is connected.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/FrontEndTool.java