From b82ea0b8e3177ff2cc45720b1772c440cc34cc14 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 4 Mar 2014 16:39:17 +0100 Subject: [PATCH] updater: use system look&feel --- .../bootstrap/src/com/intellij/idea/Main.java | 1 + updater/src/com/intellij/updater/Runner.java | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/platform/bootstrap/src/com/intellij/idea/Main.java b/platform/bootstrap/src/com/intellij/idea/Main.java index 1d7bdc8f4b64..7c328536d678 100644 --- a/platform/bootstrap/src/com/intellij/idea/Main.java +++ b/platform/bootstrap/src/com/intellij/idea/Main.java @@ -155,6 +155,7 @@ public class Main { patchCopy.getPath() + File.pathSeparator + log4jCopy.getPath(), "-Djava.io.tmpdir=" + tempDir, "-Didea.updater.log=" + PathManager.getLogPath(), + "-Dswing.defaultlaf=" + UIManager.getSystemLookAndFeelClassName(), "com.intellij.updater.Runner", "install", PathManager.getHomePath()); diff --git a/updater/src/com/intellij/updater/Runner.java b/updater/src/com/intellij/updater/Runner.java index 9f776b440256..1e57010543e9 100644 --- a/updater/src/com/intellij/updater/Runner.java +++ b/updater/src/com/intellij/updater/Runner.java @@ -66,7 +66,6 @@ public class Runner { return logFolder; } -// public static void initLogger(String logFolder) { public static void initLogger() { if (logger == null) { String logFolder = getLogDir(); @@ -82,7 +81,6 @@ public class Runner { updateError.setFile(new File(logFolder, "idea_updater_error.log").getAbsolutePath()); updateError.setLayout(new PatternLayout("%d{dd MMM yyyy HH:mm:ss} %-5p %C{1}.%M - %m%n")); updateError.setThreshold(Level.ERROR); - // The error(s) from an old run of the updater (if there were) could be found in idea_updater.log file updateError.setAppend(false); updateError.activateOptions(); @@ -198,17 +196,20 @@ public class Runner { in.close(); } - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + // todo[r.sh] to delete in IDEA 14 (after a full circle of platform updates) + if (System.getProperty("swing.defaultlaf") == null) { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } + catch (Exception ignore) { + printStackTrace(ignore); + } } - catch (Exception ignore) { - printStackTrace(ignore); - } - } - }); + }); + } new SwingUpdaterUI(props.getProperty(OLD_BUILD_DESCRIPTION), props.getProperty(NEW_BUILD_DESCRIPTION),