/** * Retrieves the annotation model from the given source viewer. * * @param sourceViewer the source viewer * @return the source viewer's annotation model or <code>null</code> if none can be found * @since 3.0 */ protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) { if(sourceViewer != null) return sourceViewer.getAnnotationModel(); return null; }
/** * Retrieves the annotation model from the given source viewer. * * @param sourceViewer the source viewer * @return the source viewer's annotation model or <code>null</code> if none can be found * @since 3.0 */ protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) { if(sourceViewer != null) return sourceViewer.getAnnotationModel(); return null; }
/** * Returns the annotation model to be used by this reconcile strategy. * * @return the annotation model of the underlying editor input or * <code>null</code> if none could be determined */ protected IAnnotationModel getAnnotationModel() { return fViewer.getAnnotationModel(); }
/** * Returns the annotation model to be used by this reconcile strategy. * * @return the annotation model of the underlying editor input or * <code>null</code> if none could be determined */ protected IAnnotationModel getAnnotationModel() { return fViewer.getAnnotationModel(); }
/** * Returns the annotation model to be used by this reconcile strategy. * * @return the annotation model of the underlying editor input or * <code>null</code> if none could be determined */ protected IAnnotationModel getAnnotationModel() { return fViewer.getAnnotationModel(); }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
public void install(ISourceViewer viewer, RevisionInformation information) { fViewer = viewer; fRevisionInfo = information; setModel(viewer.getAnnotationModel()); }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension = (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
@Override public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext quickAssistContext) { ISourceViewer viewer= quickAssistContext.getSourceViewer(); int documentOffset= quickAssistContext.getOffset(); int length= viewer != null ? viewer.getSelectedRange().y : -1; TextInvocationContext context= new TextInvocationContext(viewer, documentOffset, length); IAnnotationModel model= viewer.getAnnotationModel(); if (model == null) return fgNoSuggestionsProposal; List<ICompletionProposal> proposals= computeProposals(context, model); if (proposals.isEmpty()) return fgNoSuggestionsProposal; return proposals.toArray(new ICompletionProposal[proposals.size()]); }
public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext quickAssistContext) { ISourceViewer viewer= quickAssistContext.getSourceViewer(); int documentOffset= quickAssistContext.getOffset(); int length= viewer != null ? viewer.getSelectedRange().y : 0; TextInvocationContext context= new TextInvocationContext(viewer, documentOffset, length); IAnnotationModel model= viewer.getAnnotationModel(); if (model == null) return fgNoSuggestionsProposal; List proposals= computeProposals(context, model); if (proposals.isEmpty()) return fgNoSuggestionsProposal; return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]); }
private void uninstallAnnotationModel(LinkedModeUITarget target) { ITextViewer viewer= target.getViewer(); if (viewer instanceof ISourceViewer) { ISourceViewer sv= (ISourceViewer) viewer; IAnnotationModel model= sv.getAnnotationModel(); if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension ext= (IAnnotationModelExtension) model; ext.removeAnnotationModel(getUniqueKey()); } } }
@Override public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext quickAssistContext) { ISourceViewer viewer= quickAssistContext.getSourceViewer(); int documentOffset= quickAssistContext.getOffset(); int length= viewer != null ? viewer.getSelectedRange().y : -1; TextInvocationContext context= new TextInvocationContext(viewer, documentOffset, length); IAnnotationModel model= viewer.getAnnotationModel(); if (model == null) return fgNoSuggestionsProposal; List<ICompletionProposal> proposals= computeProposals(context, model); if (proposals.isEmpty()) return fgNoSuggestionsProposal; return proposals.toArray(new ICompletionProposal[proposals.size()]); }
private void uninstallAnnotationModel(LinkedModeUITarget target) { ITextViewer viewer= target.getViewer(); if (viewer instanceof ISourceViewer) { ISourceViewer sv= (ISourceViewer) viewer; IAnnotationModel model= sv.getAnnotationModel(); if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension ext= (IAnnotationModelExtension) model; ext.removeAnnotationModel(getUniqueKey()); } } }
protected void updateImageAndRegisterListener() { defaultImage = editor.getDefaultImage(); updateEditorImage(editor); annotationModel = editor.getInternalSourceViewer().getAnnotationModel(); if (annotationModel != null) annotationModel.addAnnotationModelListener(this); }
/** * Uninstalls the differ annotation model from the current quick diff display. * * @param column the column to remove the model from */ private void uninstallChangeRulerModel(IVerticalRulerColumn column) { if (column instanceof IChangeRulerColumn) ((IChangeRulerColumn) column).setModel(null); IAnnotationModel model= getDiffer(); if (model instanceof ILineDifferExtension) ((ILineDifferExtension) model).suspend(); ISourceViewer viewer= fViewer; if (viewer != null && viewer.getAnnotationModel() == null) viewer.showAnnotations(false); }
@Override protected Region getHoverRegionInternal(final int lineNumber, final int offset) { List<Annotation> annotations = getAnnotations(lineNumber, offset); for (Annotation annotation : annotations) { Position position = sourceViewer.getAnnotationModel().getPosition(annotation); if (position != null) { final int start = position.getOffset(); return new Region (start, position.getLength()); } } return null; }
@Override protected Region getHoverRegionInternal(final int lineNumber, final int offset) { recentAnnotationInfo = null; List<Annotation> annotations = getAnnotations(lineNumber, offset); if (annotations != null) { for (Annotation annotation : annotations) { Position position = sourceViewer.getAnnotationModel().getPosition(annotation); if (position != null) { final int start = position.getOffset(); return new Region (start, position.getLength()); } } } return null; }