public void onProjectRename(@Observes final RenameProjectEvent event) {
   if (!getView().isVisible()) {
     return;
   }
   if (!Utils.isInRepository(activeRepository, event.getOldProject())) {
     return;
   }
   if (authorizationManager.authorize(event.getOldProject(), identity)) {
     doInitialiseViewForActiveContext(
         activeOrganizationalUnit, activeRepository, event.getNewProject(), null, null, true);
   }
 }
 public void onRepositoryAdded(@Observes final NewRepositoryEvent event) {
   if (!getView().isVisible()) {
     return;
   }
   final Repository repository = event.getNewRepository();
   if (repository == null) {
     return;
   }
   if (authorizationManager.authorize(repository, identity)) {
     refresh(false);
   }
 }
 public void onOrganizationalUnitAdded(@Observes final NewOrganizationalUnitEvent event) {
   if (!getView().isVisible()) {
     return;
   }
   final OrganizationalUnit organizationalUnit = event.getOrganizationalUnit();
   if (organizationalUnit == null) {
     return;
   }
   if (authorizationManager.authorize(organizationalUnit, identity)) {
     refresh(false);
   }
 }
 public void onProjectDelete(@Observes final DeleteProjectEvent event) {
   if (!getView().isVisible()) {
     return;
   }
   if (!Utils.isInRepository(activeRepository, event.getProject())) {
     return;
   }
   if (authorizationManager.authorize(event.getProject(), identity)) {
     if (activeProject != null && activeProject.equals(event.getProject())) {
       activeProject = null;
     }
     doInitialiseViewForActiveContext(
         activeOrganizationalUnit, activeRepository, null, null, null, true);
   }
 }
 public void onProjectAdded(@Observes final NewProjectEvent event) {
   if (!getView().isVisible()) {
     return;
   }
   final Project project = event.getProject();
   if (project == null) {
     return;
   }
   if (!Utils.isInRepository(activeRepository, project)) {
     return;
   }
   if (authorizationManager.authorize(project, identity)) {
     doInitialiseViewForActiveContext(
         activeOrganizationalUnit, activeRepository, project, null, null, false);
   }
 }