make compilable in 3.2
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPEditor.java
index 5dcf343..e692e83 100644 (file)
@@ -37,7 +37,6 @@ import net.sourceforge.phpdt.core.compiler.ITerminalSymbols;
 import net.sourceforge.phpdt.core.compiler.InvalidInputException;
 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
 import net.sourceforge.phpdt.internal.compiler.parser.SyntaxError;
-import net.sourceforge.phpdt.internal.core.CompilationUnit;
 import net.sourceforge.phpdt.internal.ui.actions.CompositeActionGroup;
 import net.sourceforge.phpdt.internal.ui.actions.FoldingActionGroup;
 import net.sourceforge.phpdt.internal.ui.actions.SelectionConverter;
@@ -98,7 +97,6 @@ import org.eclipse.jface.text.ITextPresentationListener;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
 import org.eclipse.jface.text.ITextViewerExtension2;
-import org.eclipse.jface.text.ITextViewerExtension3;
 import org.eclipse.jface.text.ITextViewerExtension4;
 import org.eclipse.jface.text.ITextViewerExtension5;
 import org.eclipse.jface.text.ITypedRegion;
@@ -2186,8 +2184,8 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
 
                        try {
                                int widgetLocation = styledText.getOffsetAtLocation(new Point(x, y));
-                               if (textViewer instanceof ITextViewerExtension3) {
-                                       ITextViewerExtension3 extension = (ITextViewerExtension3) textViewer;
+                               if (textViewer instanceof ITextViewerExtension5) {
+                                       ITextViewerExtension5 extension = (ITextViewerExtension5) textViewer;
                                        return extension.widgetOffset2ModelOffset(widgetLocation);
                                } else {
                                        IRegion visibleRegion = textViewer.getVisibleRegion();
@@ -3316,14 +3314,15 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
         *          <code>true</code> if search direction is forward,
         *          <code>false</code> if backward
         */
-       public void gotoAnnotation(boolean forward) {
+       public Annotation gotoAnnotation(boolean forward) {
                ITextSelection selection = (ITextSelection) getSelectionProvider().getSelection();
                Position position = new Position(0, 0);
+               Annotation annotation=null;
                if (false /* delayed - see bug 18316 */) {
-                       getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
+                       annotation=getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
                        selectAndReveal(position.getOffset(), position.getLength());
                } else /* no delay - see bug 18316 */{
-                       Annotation annotation = getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
+                       annotation = getNextAnnotation(selection.getOffset(), selection.getLength(), forward, position);
                        setStatusLineErrorMessage(null);
                        setStatusLineMessage(null);
                        if (annotation != null) {
@@ -3332,6 +3331,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
                                setStatusLineMessage(annotation.getText());
                        }
                }
+               return annotation;
        }
 
        /**
@@ -4779,8 +4779,8 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
                int targetOffset = (PHPPairMatcher.RIGHT == anchor) ? offset : offset + length - 1;
 
                boolean visible = false;
-               if (sourceViewer instanceof ITextViewerExtension3) {
-                       ITextViewerExtension3 extension = (ITextViewerExtension3) sourceViewer;
+               if (sourceViewer instanceof ITextViewerExtension5) {
+                       ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer;
                        visible = (extension.modelOffset2WidgetOffset(targetOffset) > -1);
                } else {
                        IRegion visibleRegion = sourceViewer.getVisibleRegion();
@@ -4950,7 +4950,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
         *         otherwise
         * @since 3.0
         */
-       private boolean isNavigationTarget(Annotation annotation) {
+       protected boolean isNavigationTarget(Annotation annotation) {
                Preferences preferences = EditorsUI.getPluginPreferences();
                AnnotationPreference preference = getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
                // See bug 41689