[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-mtj-commit] r1467 - trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor

Author: dmarques
Date: 2009-08-31 12:18:25 -0400 (Mon, 31 Aug 2009)
New Revision: 1467

Modified:
   trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionSourcePage.java
   trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionViewer.java
Log:
[286620] Fixing illegal inheritance in the JavaSourceViewer class

Modified: trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionSourcePage.java
===================================================================
--- trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionSourcePage.java	2009-08-28 21:58:56 UTC (rev 1466)
+++ trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionSourcePage.java	2009-08-31 16:18:25 UTC (rev 1467)
@@ -9,6 +9,7 @@
  * Contributors:
  *     IBM Corporation         - initial API and implementation
  *     Diego Sandin (Motorola) - Adapted code from org.eclipse.pde.ui/PDEProjectionSourcePage
+ *     David Marques (Motorola) - Avoiding extending ProjectionViewer.
  */
 package org.eclipse.mtj.internal.ui.editor;
 
@@ -199,11 +200,11 @@
     @Override
     protected ISourceViewer createSourceViewer(Composite parent,
             IVerticalRuler ruler, int styles) {
-        ISourceViewer viewer = new MTJProjectionViewer(parent, ruler,
+        MTJProjectionViewer viewer = new MTJProjectionViewer(parent, ruler,
                 getOverviewRuler(), isOverviewRulerVisible(), styles,
                 isQuickOutlineEnabled());
         getSourceViewerDecorationSupport(viewer);
-        return viewer;
+        return viewer.getDecoratedViewer();
     }
 
     /* (non-Javadoc)

Modified: trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionViewer.java
===================================================================
--- trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionViewer.java	2009-08-28 21:58:56 UTC (rev 1466)
+++ trunk/plugins/org.eclipse.mtj.ui/src/org/eclipse/mtj/internal/ui/editor/MTJProjectionViewer.java	2009-08-31 16:18:25 UTC (rev 1467)
@@ -16,15 +16,16 @@
 import org.eclipse.jface.text.information.IInformationPresenter;
 import org.eclipse.jface.text.source.IOverviewRuler;
 import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.SourceViewer;
 import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
 import org.eclipse.mtj.internal.ui.editor.text.ChangeAwareSourceViewerConfiguration;
+import org.eclipse.mtj.internal.ui.util.SourceViewerDecorator;
 import org.eclipse.swt.widgets.Composite;
 
 /**
  * 
  */
-public class MTJProjectionViewer extends SourceViewer {
+public class MTJProjectionViewer extends SourceViewerDecorator {
 
     /**
      * Text operation code for requesting the quick outline for the current
@@ -46,8 +47,8 @@
     public MTJProjectionViewer(Composite parent, IVerticalRuler ruler,
             IOverviewRuler overviewRuler, boolean showsAnnotationOverview,
             int styles, boolean isQuickOutlineEnabled) {
-        super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
-
+        super(new ProjectionViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles));
+        
         fIsQuickOutlineEnabled = isQuickOutlineEnabled;
     }