X-Git-Url: http://secure.phpeclipse.com
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java
index 771eea3..0ba1930 100644
--- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java
+++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java
@@ -48,7 +48,7 @@ import net.sourceforge.phpdt.internal.ui.text.JavaWordFinder;
import net.sourceforge.phpdt.internal.ui.text.JavaWordIterator;
import net.sourceforge.phpdt.internal.ui.text.PHPPairMatcher;
import net.sourceforge.phpdt.internal.ui.text.PreferencesAdapter;
-import net.sourceforge.phpdt.internal.ui.text.java.JavaExpandHover;
+import net.sourceforge.phpdt.internal.ui.text.java.hover.JavaExpandHover;
import net.sourceforge.phpdt.internal.ui.viewsupport.ISelectionListenerWithAST;
import net.sourceforge.phpdt.internal.ui.viewsupport.IViewPartInputProvider;
import net.sourceforge.phpdt.internal.ui.viewsupport.SelectionListenerWithASTManager;
@@ -118,6 +118,7 @@ import org.eclipse.jface.text.source.IOverviewRuler;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.ISourceViewerExtension2;
import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.IVerticalRulerColumn;
import org.eclipse.jface.text.source.OverviewRuler;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.text.source.projection.ProjectionSupport;
@@ -3314,14 +3315,15 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
* true
if search direction is forward,
* false
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) {
@@ -3330,6 +3332,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
setStatusLineMessage(annotation.getText());
}
}
+ return annotation;
}
/**
@@ -4948,7 +4951,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
@@ -5392,12 +5395,53 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
/*
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createCompositeRuler()
*/
- protected CompositeRuler createCompositeRuler() {
+// protected CompositeRuler createCompositeRuler() {
+// if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
+// return super.createCompositeRuler();
+//
+// CompositeRuler ruler = new CompositeRuler();
+// AnnotationRulerColumn column = new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
+// column.setHover(new JavaExpandHover(ruler, getAnnotationAccess(), new IDoubleClickListener() {
+//
+// public void doubleClick(DoubleClickEvent event) {
+// // for now: just invoke ruler double click action
+// triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK);
+// }
+//
+// private void triggerAction(String actionID) {
+// IAction action = getAction(actionID);
+// if (action != null) {
+// if (action instanceof IUpdate)
+// ((IUpdate) action).update();
+// // hack to propagate line change
+// if (action instanceof ISelectionListener) {
+// ((ISelectionListener) action).selectionChanged(null, null);
+// }
+// if (action.isEnabled())
+// action.run();
+// }
+// }
+//
+// }));
+// ruler.addDecorator(0, column);
+//
+// if (isLineNumberRulerVisible())
+// ruler.addDecorator(1, createLineNumberRulerColumn());
+// else if (isPrefQuickDiffAlwaysOn())
+// ruler.addDecorator(1, createChangeRulerColumn());
+//
+// return ruler;
+// }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createAnnotationRulerColumn(org.eclipse.jface.text.source.CompositeRuler)
+ * @since 3.2
+ */
+ protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler) {
if (!getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
- return super.createCompositeRuler();
+ return super.createAnnotationRulerColumn(ruler);
- CompositeRuler ruler = new CompositeRuler();
- AnnotationRulerColumn column = new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
+ AnnotationRulerColumn column= new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
column.setHover(new JavaExpandHover(ruler, getAnnotationAccess(), new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
@@ -5406,13 +5450,13 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
}
private void triggerAction(String actionID) {
- IAction action = getAction(actionID);
+ IAction action= getAction(actionID);
if (action != null) {
if (action instanceof IUpdate)
((IUpdate) action).update();
// hack to propagate line change
if (action instanceof ISelectionListener) {
- ((ISelectionListener) action).selectionChanged(null, null);
+ ((ISelectionListener)action).selectionChanged(null, null);
}
if (action.isEnabled())
action.run();
@@ -5420,16 +5464,9 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
}
}));
- ruler.addDecorator(0, column);
-
- if (isLineNumberRulerVisible())
- ruler.addDecorator(1, createLineNumberRulerColumn());
- else if (isPrefQuickDiffAlwaysOn())
- ruler.addDecorator(1, createChangeRulerColumn());
-
- return ruler;
+
+ return column;
}
-
/**
* Returns the folding action group, or null
if there is none.
*