@Override
	public boolean isValid() {
		String repositoryName = panel.getRepositoryName();
		if (panel.isCreateRepositorySelected()) {
			if (repositoryName.length() == 0) {
				return false;
			}
			if (!NamingUtilities.isValidProjectName(repositoryName)) {
				setStatusMessage("Invalid project repository name");
				return false;
			}
			if (List.of(repositoryNames).contains(repositoryName)) {
				setStatusMessage("Repository " + repositoryName + " already exists");
				return false;
			}
		}
		else if (repositoryName == null) {
			setStatusMessage("Please select a repository");
			return false;
		}
		return true;
	}
Wizard step in the new project wizard selecting or creating a new repository in a Ghidra server.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/wizard/project/RepositoryStep.java