/** * Closes the splash screen associated with the given place request, if any. Internally, this method should be * invoked every time a part or perspective is removed from the workbench (cleaning up after the corresponding * earlier call to {@link #addSplashScreenFor(PlaceRequest)}. * @param place the place whose opening may have triggered a splash screen to launch. Must not be null. */ private void closeSplashScreen(final PlaceRequest place) { SplashScreenActivity splashScreenActivity = availableSplashScreens.remove(place.getIdentifier()); if (splashScreenActivity != null) { try { splashScreenActivity.closeIfOpen(); } catch (Exception ex) { lifecycleErrorHandler.handle(splashScreenActivity, LifecyclePhase.CLOSE, ex); } activityManager.destroyActivity(splashScreenActivity); newSplashScreenActiveEvent.fire(new NewSplashScreenActiveEvent()); } }
/** * Finds and opens the splash screen for the given place, if such a splash screen exists. The splash screen might * not actually display; each splash screen keeps track of its own preference setting for whether or not the user * wants to see it. * <p/> * Whether or not it chooses to display itself, the splash screen will be recorded in * {@link #availableSplashScreens} for lookup (for example, see {@link SplashScreenMenuPresenter}) and later disposal. * Internally, this method should be called every time any part or perspective is added to the workbench, and called * again when that part or perspective is removed. * @param place the place that has just been added to the workbench. Must not be null. */ private void addSplashScreenFor(final PlaceRequest place) { final SplashScreenActivity splashScreen = activityManager.getSplashScreenInterceptor(place); if (splashScreen != null) { availableSplashScreens.put(place.getIdentifier(), splashScreen); try { splashScreen.onOpen(); } catch (Exception ex) { availableSplashScreens.remove(place.getIdentifier()); lifecycleErrorHandler.handle(splashScreen, LifecyclePhase.OPEN, ex); activityManager.destroyActivity(splashScreen); return; } } newSplashScreenActiveEvent.fire(new NewSplashScreenActiveEvent()); }