CustomizeIDEWizardDialogInterface -> CommonCustomizeIDEWizardDialog, change behavior...
authorSasha Blashenkov <Sasha.Blashenkov@jetbrains.com>
Tue, 15 Sep 2020 12:13:31 +0000 (15:13 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 16 Sep 2020 13:15:05 +0000 (13:15 +0000)
GitOrigin-RevId: 74c5274ad35299d0d083d4d9946f17a1770464c7

platform/platform-impl/src/com/intellij/ide/customize/CommonCustomizeIDEWizardDialog.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialog.java
platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialogInterface.java [deleted file]
platform/platform-impl/src/com/intellij/idea/StartupUtil.java

diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CommonCustomizeIDEWizardDialog.java b/platform/platform-impl/src/com/intellij/ide/customize/CommonCustomizeIDEWizardDialog.java
new file mode 100644 (file)
index 0000000..7969234
--- /dev/null
@@ -0,0 +1,17 @@
+package com.intellij.ide.customize;
+
+import java.awt.event.ActionListener;
+
+/**
+ * Allows customization of initial wizard dialog.
+ *
+ * Must have a constructor with four params: @NotNull CustomizeIDEWizardStepsProvider stepsProvider, @Nullable StartupUtil.AppStarter appStarter,
+ *                                           boolean beforeSplash, boolean afterSplash
+ */
+public interface CommonCustomizeIDEWizardDialog extends ActionListener {
+    void show();
+
+    boolean showIfNeeded();
+
+    void doCancelAction();
+}
index 90fc7a55f73b47054a9f7632189a517fed414af6..bdd19061591b41188c61085392503b5e5234ca3f 100644 (file)
@@ -27,7 +27,7 @@ import java.util.List;
 
 import static com.intellij.openapi.util.text.HtmlChunk.*;
 
-public class CustomizeIDEWizardDialog extends DialogWrapper implements CustomizeIDEWizardDialogInterface {
+public class CustomizeIDEWizardDialog extends DialogWrapper implements CommonCustomizeIDEWizardDialog {
   protected static final String BUTTONS = "BUTTONS";
   protected static final String NO_BUTTONS = "NO_BUTTONS";
 
@@ -259,7 +259,7 @@ public class CustomizeIDEWizardDialog extends DialogWrapper implements Customize
   }
 
   @Contract(value = "!null->!null" ,pure = true)
-  protected static String ensureHTML(@Nullable String s) {
+  private static String ensureHTML(@Nullable String s) {
     return s == null ? null : s.startsWith("<html>") ? s : "<html>" + StringUtil.escapeXmlEntities(s) + "</html>";
   }
 }
\ No newline at end of file
diff --git a/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialogInterface.java b/platform/platform-impl/src/com/intellij/ide/customize/CustomizeIDEWizardDialogInterface.java
deleted file mode 100644 (file)
index 0d4ebe0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.intellij.ide.customize;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-public interface CustomizeIDEWizardDialogInterface extends ActionListener {
-    void show();
-
-    boolean showIfNeeded();
-
-    @Override
-    void actionPerformed(@NotNull ActionEvent e);
-
-    void doCancelAction();
-}
index cf5f799702dea5f13f122c0820a85f1f98458540..fe6c083b9446f84c5ef2dd3c94cfb1a171555324 100644 (file)
@@ -9,8 +9,8 @@ import com.intellij.diagnostic.LoadingState;
 import com.intellij.diagnostic.StartUpMeasurer;
 import com.intellij.ide.*;
 import com.intellij.ide.customize.AbstractCustomizeWizardStep;
+import com.intellij.ide.customize.CommonCustomizeIDEWizardDialog;
 import com.intellij.ide.customize.CustomizeIDEWizardDialog;
-import com.intellij.ide.customize.CustomizeIDEWizardDialogInterface;
 import com.intellij.ide.customize.CustomizeIDEWizardStepsProvider;
 import com.intellij.ide.gdpr.Agreements;
 import com.intellij.ide.gdpr.ConsentOptions;
@@ -726,12 +726,10 @@ public final class StartupUtil {
         Class<?> dialogClass = Class.forName(stepsDialogName);
         Constructor<?> constr =
                 dialogClass.getConstructor(CustomizeIDEWizardStepsProvider.class, AppStarter.class, boolean.class, boolean.class);
-        ((CustomizeIDEWizardDialogInterface)constr.newInstance(provider, appStarter, true, false)).showIfNeeded();
+        ((CommonCustomizeIDEWizardDialog)constr.newInstance(provider, appStarter, true, false)).showIfNeeded();
       }
       catch (Throwable e) {
-        System.out.println("failed to start custom wizard: ");
-        e.getCause().printStackTrace();
-        new CustomizeIDEWizardDialog(provider, appStarter, true, false).showIfNeeded();
+        Main.showMessage("Configuration Wizard Failed", e); return;
       }
     }
     else {