From: <jar...@us...> - 2012-04-10 18:56:48
|
Revision: 21568 http://jedit.svn.sourceforge.net/jedit/?rev=21568&view=rev Author: jarekczek Date: 2012-04-10 18:56:42 +0000 (Tue, 10 Apr 2012) Log Message: ----------- Catched exceptions from SwingUtilities.updateComponentTreeUI(window) call in jEdit.initPLAF(), similarly as the exceptions from UIManager.setLookAndFeel were catched. If the exceptions are not catched, then jedit may hang, like in #3512420. Made initplaf log more verbosely and report failure as warning. Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/jEdit.java Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2012-04-10 17:23:45 UTC (rev 21567) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2012-04-10 18:56:42 UTC (rev 21568) @@ -3698,8 +3698,13 @@ private static void initPLAF() { String lf = getProperty("lookAndFeel"); + String sLfOld = null; + String sLfNew = null; + LookAndFeel lfOld = UIManager.getLookAndFeel(); + if (lfOld != null) + sLfOld = lfOld.getClass().getName(); - if (isStartupDone() && UIManager.getLookAndFeel().getClass().getName().equals(lf)) + if (isStartupDone() && sLfOld != null && sLfOld.equals(lf)) { return; } @@ -3763,6 +3768,20 @@ Log.log(Log.ERROR,jEdit.class,e); } + LookAndFeel lfNew = UIManager.getLookAndFeel(); + if (lfNew != null) + sLfNew = lfNew.getClass().getName(); + Log.log(Log.DEBUG, jEdit.class, + "initPLAF " + + (EventQueue.isDispatchThread() ? "edt" + : "non-edt") + + " old=" + sLfOld + + " requested=" + lf + + " new=" + sLfNew ); + if (lf == null || !lf.equals(sLfNew)) + Log.log(Log.WARNING, jEdit.class, + "inifPLAF failed to set required l&f"); + UIDefaults defaults = UIManager.getDefaults(); // give all Swing components our colors @@ -3815,12 +3834,23 @@ if (isStartupDone()) { + int iWindow = 0; for (Window window : Window.getWindows()) { - SwingUtilities.updateComponentTreeUI(window); + try + { + SwingUtilities.updateComponentTreeUI(window); + } + catch(Exception e) + { + Log.log(Log.ERROR, jEdit.class, + "Window " + iWindow + + ": " + window, e); + break; + } + iWindow++; } } - Log.log(Log.MESSAGE, jEdit.class, "InitPLAF: " + lf); } //}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |