Lines 84-91
Link Here
|
84 |
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; |
84 |
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; |
85 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumn; |
85 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumn; |
86 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension; |
86 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension; |
87 |
import org.eclipse.jface.text.revisions.RevisionInformation; |
|
|
88 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension.RenderingMode; |
87 |
import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension.RenderingMode; |
|
|
88 |
import org.eclipse.jface.text.revisions.RevisionInformation; |
89 |
import org.eclipse.jface.text.source.Annotation; |
89 |
import org.eclipse.jface.text.source.Annotation; |
90 |
import org.eclipse.jface.text.source.AnnotationRulerColumn; |
90 |
import org.eclipse.jface.text.source.AnnotationRulerColumn; |
91 |
import org.eclipse.jface.text.source.ChangeRulerColumn; |
91 |
import org.eclipse.jface.text.source.ChangeRulerColumn; |
Lines 100-106
Link Here
|
100 |
import org.eclipse.jface.text.source.ISourceViewer; |
100 |
import org.eclipse.jface.text.source.ISourceViewer; |
101 |
import org.eclipse.jface.text.source.ISourceViewerExtension; |
101 |
import org.eclipse.jface.text.source.ISourceViewerExtension; |
102 |
import org.eclipse.jface.text.source.ISourceViewerExtension3; |
102 |
import org.eclipse.jface.text.source.ISourceViewerExtension3; |
103 |
import org.eclipse.jface.text.source.ISourceViewerExtension5; |
|
|
104 |
import org.eclipse.jface.text.source.IVerticalRuler; |
103 |
import org.eclipse.jface.text.source.IVerticalRuler; |
105 |
import org.eclipse.jface.text.source.IVerticalRulerColumn; |
104 |
import org.eclipse.jface.text.source.IVerticalRulerColumn; |
106 |
import org.eclipse.jface.text.source.LineChangeHover; |
105 |
import org.eclipse.jface.text.source.LineChangeHover; |
Lines 1251-1257
Link Here
|
1251 |
|
1250 |
|
1252 |
action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowChangeRulerInformation.", IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$ |
1251 |
action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowChangeRulerInformation.", IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$ |
1253 |
public void run() { |
1252 |
public void run() { |
1254 |
showRulerInformation(true); |
1253 |
showChangeRulerInformation(); |
1255 |
} |
1254 |
} |
1256 |
}; |
1255 |
}; |
1257 |
action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_CHANGE_RULER_INFORMATION_ID); |
1256 |
action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_CHANGE_RULER_INFORMATION_ID); |
Lines 1259-1265
Link Here
|
1259 |
|
1258 |
|
1260 |
action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowRulerAnnotationInformation.", IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$ |
1259 |
action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowRulerAnnotationInformation.", IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$ |
1261 |
public void run() { |
1260 |
public void run() { |
1262 |
showRulerInformation(false); |
1261 |
showRulerAnnotationInformation(); |
1263 |
} |
1262 |
} |
1264 |
}; |
1263 |
}; |
1265 |
action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_RULER_ANNOTATION_INFORMATION_ID); |
1264 |
action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_RULER_ANNOTATION_INFORMATION_ID); |
Lines 1267-1280
Link Here
|
1267 |
} |
1266 |
} |
1268 |
|
1267 |
|
1269 |
/** |
1268 |
/** |
1270 |
* Opens a sticky ruler hover for the caret line. Does nothing if no hover is available. |
1269 |
* Opens a sticky change ruler hover for the caret line. Does nothing if no change hover is |
|
|
1270 |
* available. |
1271 |
* |
1271 |
* |
1272 |
* @param changeHover <code>true</code> to show change hover, <code>false</code> to show |
1272 |
* @since 3.5 |
1273 |
* annotation hover |
|
|
1274 |
* |
1275 |
* @since 3.6 |
1276 |
*/ |
1273 |
*/ |
1277 |
private void showRulerInformation(boolean changeHover) { |
1274 |
private void showChangeRulerInformation() { |
1278 |
IVerticalRuler ruler= getVerticalRuler(); |
1275 |
IVerticalRuler ruler= getVerticalRuler(); |
1279 |
if (!(ruler instanceof CompositeRuler) || fLineColumn == null) |
1276 |
if (!(ruler instanceof CompositeRuler) || fLineColumn == null) |
1280 |
return; |
1277 |
return; |
Lines 1292-1305
Link Here
|
1292 |
|
1289 |
|
1293 |
compositeRuler.setLocationOfLastMouseButtonActivity(x, y); |
1290 |
compositeRuler.setLocationOfLastMouseButtonActivity(x, y); |
1294 |
|
1291 |
|
1295 |
IAnnotationHover hover= null; |
1292 |
IAnnotationHover hover= fLineColumn.getHover(); |
1296 |
if (changeHover) { |
1293 |
showFocusedRulerHover(hover, sourceViewer, caretOffset); |
1297 |
hover= fLineColumn.getHover(); |
1294 |
} |
1298 |
} else { |
1295 |
|
1299 |
if (sourceViewer instanceof ISourceViewerExtension5) { |
1296 |
/** |
1300 |
hover= ((ISourceViewerExtension5)sourceViewer).getAnnotationHover(); |
1297 |
* Opens a sticky annotation ruler hover for the caret line. Does nothing if no annotation hover |
1301 |
} |
1298 |
* is available. |
1302 |
} |
1299 |
* |
|
|
1300 |
* @since 3.6 |
1301 |
*/ |
1302 |
private void showRulerAnnotationInformation() { |
1303 |
ISourceViewer sourceViewer= getSourceViewer(); |
1304 |
IAnnotationHover hover= getSourceViewerConfiguration().getAnnotationHover(sourceViewer); |
1305 |
int caretOffset= sourceViewer.getTextWidget().getCaretOffset(); |
1306 |
|
1307 |
showFocusedRulerHover(hover, sourceViewer, caretOffset); |
1308 |
} |
1309 |
|
1310 |
/** |
1311 |
* Shows a focused hover at the specified offset. |
1312 |
* Does nothing if <code>hover</code> is <code>null</code> or cannot be shown. |
1313 |
* |
1314 |
* @param hover the hover to be shown, can be <code>null</code> |
1315 |
* @param sourceViewer the source viewer |
1316 |
* @param caretOffset the caret offset |
1317 |
* |
1318 |
* @since 3.6 |
1319 |
*/ |
1320 |
private void showFocusedRulerHover(IAnnotationHover hover, ISourceViewer sourceViewer, int caretOffset) { |
1303 |
if (hover == null) |
1321 |
if (hover == null) |
1304 |
return; |
1322 |
return; |
1305 |
|
1323 |
|
Lines 1320-1326
Link Here
|
1320 |
} catch (BadLocationException e) { |
1338 |
} catch (BadLocationException e) { |
1321 |
return; |
1339 |
return; |
1322 |
} |
1340 |
} |
1323 |
} |
1341 |
} |
1324 |
|
1342 |
|
1325 |
/** |
1343 |
/** |
1326 |
* Creates and registers the print action. |
1344 |
* Creates and registers the print action. |