@Override protected void computeInformation() { Point location= getHoverEventLocation(); int line= getVerticalRulerInfo().toDocumentLineNumber(location.y); IAnnotationHover hover= getAnnotationHover(); IInformationControlCreator controlCreator= null; if (hover instanceof IAnnotationHoverExtension) controlCreator= ((IAnnotationHoverExtension)hover).getHoverControlCreator(); setCustomInformationControlCreator(controlCreator); setInformation(hover.getHoverInfo(getSourceViewer(), line), computeArea(location.y)); }
@Override public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) { int first= adaptFirstLine(sourceViewer, lineRange.getStartLine()); int last= adaptLastLine(sourceViewer, lineRange.getStartLine() + lineRange.getNumberOfLines() - 1); String content= computeContent(sourceViewer, first, last, visibleLines); return formatSource(content); }
@Override public void setModel(IAnnotationModel model) { if (fAllowSetModel && model != fModel) { if (fModel != null) fModel.removeAnnotationModelListener(fAnnotationListener); fModel= model; if (fModel != null) fModel.addAnnotationModelListener(fAnnotationListener); postRedraw(); } }
@Override public void setModel(IAnnotationModel model) { if (model != fModel || model != null) { if (fModel != null) fModel.removeAnnotationModelListener(fInternalListener); fModel= model; if (fModel != null) fModel.addAnnotationModelListener(fInternalListener); update(); } }
/** * Creates the visual annotation model on top of the given annotation model. * * @param annotationModel the wrapped annotation model * @return the visual annotation model on top of the given annotation model * @since 3.0 */ protected IAnnotationModel createVisualAnnotationModel(IAnnotationModel annotationModel) { IAnnotationModelExtension model= new AnnotationModel(); model.addAnnotationModel(MODEL_ANNOTATION_MODEL, annotationModel); return (IAnnotationModel) model; }
/** * Adds the projection annotation model to the given annotation model. * * @param model the model to which the projection annotation model is added */ private void addProjectionAnnotationModel(IAnnotationModel model) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension) model; extension.addAnnotationModel(ProjectionSupport.PROJECTION, fProjectionAnnotationModel); model.addAnnotationModelListener(fAnnotationModelListener); } }
@Override public IQuickAssistInvocationContext getQuickAssistInvocationContext() { Point selection= getSelectedRange(); return new TextInvocationContext(this, selection.x, selection.y); }
@Override public void mouseUp(MouseEvent event) { int lineNumber; if (isPropagatingMouseListener()) { fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); lineNumber= fParentRuler.getLineOfLastMouseButtonActivity(); } else lineNumber= fParentRuler.toDocumentLineNumber(event.y); if (1 == event.button) mouseClicked(lineNumber); }
@Override public void mouseMove(MouseEvent event) { if (fIsListeningForMove && !autoScroll(event)) { int newLine= fParentRuler.toDocumentLineNumber(event.y); expandSelection(newLine); } fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); }
@Override public void setModel(IAnnotationModel model) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension) model; model= extension.getAnnotationModel(ProjectionSupport.PROJECTION); } super.setModel(model); }
@Override public void mouseDoubleClick(MouseEvent event) { fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); stopSelecting(); stopAutoScroll(); }
@Override public void mouseDown(MouseEvent event) { fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); // see bug 45700 if (event.button == 1) { startSelecting((event.stateMask & SWT.SHIFT) != 0); } }
@Override public void dispose() { if (fMatcher != null) { if (fMatcher instanceof ICharacterPairMatcherExtension && fTextListener != null) { installUninstallTextListener(false); } fMatcher.clear(); fMatcher= null; } fColor= null; fTextWidget= null; }
@Override protected void computeInformation() { Point location= getHoverEventLocation(); int line= getVerticalRulerInfo().toDocumentLineNumber(location.y); IAnnotationHover hover= getAnnotationHover(); IInformationControlCreator controlCreator= null; if (hover instanceof IAnnotationHoverExtension) controlCreator= ((IAnnotationHoverExtension)hover).getHoverControlCreator(); setCustomInformationControlCreator(controlCreator); setInformation(hover.getHoverInfo(getSourceViewer(), line), computeArea(location.y)); }
@Override public void setModel(IAnnotationModel model) { if (fAllowSetModel && model != fModel) { if (fModel != null) fModel.removeAnnotationModelListener(fInternalListener); fModel= model; if (fModel != null) fModel.addAnnotationModelListener(fInternalListener); postRedraw(); } }
@Override public void setModel(IAnnotationModel model) { if (model != fModel || model != null) { if (fModel != null) fModel.removeAnnotationModelListener(fInternalListener); fModel= model; if (fModel != null) fModel.addAnnotationModelListener(fInternalListener); update(); } }
/** * Adds the projection annotation model to the given annotation model. * * @param model the model to which the projection annotation model is added */ private void addProjectionAnnotationModel(IAnnotationModel model) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension) model; extension.addAnnotationModel(ProjectionSupport.PROJECTION, fProjectionAnnotationModel); model.addAnnotationModelListener(fAnnotationModelListener); } }
@Override public IQuickAssistInvocationContext getQuickAssistInvocationContext() { Point selection= getSelectedRange(); return new TextInvocationContext(this, selection.x, selection.y); }
@Override public void mouseUp(MouseEvent event) { int lineNumber; if (isPropagatingMouseListener()) { fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y); lineNumber= fParentRuler.getLineOfLastMouseButtonActivity(); } else lineNumber= fParentRuler.toDocumentLineNumber(event.y); if (1 == event.button) mouseClicked(lineNumber); }
@Override public void dispose() { if (fMatcher != null) { if (fMatcher instanceof ICharacterPairMatcherExtension && fTextListener != null) { installUninstallTextListener(false); } fMatcher.clear(); fMatcher= null; } fColor= null; fTextWidget= null; }