@Override
 public void setVisible(boolean visible) {
   if (visible) {
     // Need to filter repository list based on currently selected repository
     // Will also keep track of which filter is applied, so we don't create
     // additional content providers unnecessarily.
     GuvWizardModel model = ((IGuvnorWizard) super.getWizard()).getModel();
     String currentSelection = model.getRepLocation();
     // Not supposed to use this page without setting the target repository in the model
     assert (currentSelection != null);
     // If we had a repository selection before that is different from the current selection
     if (previousSelection != null && !currentSelection.equals(previousSelection)) {
       handleRepositoryCreation();
       RepositoryContentProvider cp = new RepositoryContentProvider();
       cp.setRepositorySelection(currentSelection);
       viewer.setContentProvider(cp);
       viewer.setInput(viewer);
       previousSelection = currentSelection;
     } else {
       // If we didn't have a repository selection before (first time this page is loaded)
       if (previousSelection == null) {
         handleRepositoryCreation();
         RepositoryContentProvider cp = new RepositoryContentProvider();
         cp.setRepositorySelection(currentSelection);
         viewer.setContentProvider(cp);
         viewer.setInput(viewer);
         previousSelection = currentSelection;
       }
     }
   }
   super.setVisible(visible);
 }
 private void handleRepositoryCreation() {
   // First we'll see if the repository already exists
   GuvWizardModel model = ((IGuvnorWizard) super.getWizard()).getModel();
   if (model.shouldCreateNewRep() && model.getRepLocation() != null) {
     GuvnorRepository theRep =
         Activator.getLocationManager().findRepository(model.getRepLocation());
     if (theRep != null) {
       // The repository already exists, nothing to do
       return;
     }
     try {
       WizardUtils.createGuvnorRepository(model);
     } catch (Exception e) {
       super.setErrorMessage(e.getMessage());
       Activator.getDefault().displayError(IStatus.ERROR, e.getMessage(), e, true);
     }
   }
 }