@Override
  public void stop(BundleContext context) throws Exception {
    LaunchConfigAffectingChangesListener.INSTANCE.stop();

    plugin = null;
    logger = null;

    super.stop(context);
  }
  @Override
  public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    logger = new Logger(this);

    // Force the installation id initialization before SDK registration.
    getInstallationId();

    GdtPreferences.registerSdks();
    ProjectUtilities.setWebAppProjectCreatorFactory(WebAppProjectCreator.FACTORY);

    /*
     * Execute this on the UI thread. This has the effect of delaying the
     * execution until the Workbench is running and the UI is available. This is
     * necessary because the code in this method manipulates the Workbench UI.
     */
    Display.getDefault()
        .asyncExec(
            new Runnable() {
              public void run() {
                maybeAddNewWizardActionsToWorkbench();
              }
            });

    LaunchConfigAffectingChangesListener.INSTANCE.start();

    // Load problem severities
    GdtProblemSeverities.initializeInstance(
        new Class<?>[] {
          AppEngineProblemType.class, GWTProblemType.class,
          RemoteServiceProblemType.class, UiBinderJavaProblemType.class,
          ClientBundleProblemType.class, ProjectStructureOrSdkProblemType.class,
          UiBinderTemplateProblemType.class
        },
        GdtPreferences.getEncodedProblemSeverities());

    rebuildGoogleProjectsIfPluginVersionChanged();

    new ProjectMigrator().migrate();
  }