|
From: <caw...@us...> - 2006-07-20 00:07:31
|
Revision: 1524 Author: cawilliams Date: 2006-07-19 17:07:27 -0700 (Wed, 19 Jul 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1524&view=rev Log Message: ----------- eliminate problem where UI preference pages were having a reconciler attached which would throw NullPointer exceptions Modified Paths: -------------- branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java Modified: branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java =================================================================== --- branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java 2006-07-20 00:06:30 UTC (rev 1523) +++ branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/RubySourceViewerConfiguration.java 2006-07-20 00:07:27 UTC (rev 1524) @@ -375,15 +375,18 @@ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) */ public IReconciler getReconciler(ISourceViewer sourceViewer) { - RubyReconciler reconciler = new RubyReconciler(fTextEditor, new RubyReconcilingStrategy( - (RubyAbstractEditor) fTextEditor), true); - reconciler.setIsIncrementalReconciler(false); - // TODO Uncomment when we move to Eclipse 3.2 - // ECLIPSE 3.2 - //reconciler.setIsAllowedToModifyDocument(false); - reconciler.setProgressMonitor(new NullProgressMonitor()); - reconciler.setDelay(500); - return reconciler; + final ITextEditor editor = getEditor(); + if (editor != null && editor.isEditable()) { + RubyReconciler reconciler = new RubyReconciler(fTextEditor, + new RubyReconcilingStrategy( + (RubyAbstractEditor) fTextEditor), true); + reconciler.setIsIncrementalReconciler(false); + reconciler.setIsAllowedToModifyDocument(false); + reconciler.setProgressMonitor(new NullProgressMonitor()); + reconciler.setDelay(500); + return reconciler; + } + return null; } private IRubyProject getProject() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |