/* * @see org.eclipse.jface.text.source.AnnotationPainter#findAnnotationModel(org.eclipse.jface.text.source.ISourceViewer) */ protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) { if (sourceViewer instanceof ProjectionViewer) { ProjectionViewer projectionViewer = (ProjectionViewer) sourceViewer; return projectionViewer.getProjectionAnnotationModel(); } return null; }
/** * Implements the contract of {@link * org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)} by forwarding the adapter * requests to the given viewer. * * @param viewer the viewer * @param required the required class of the adapter * @return the adapter or <code>null</code> */ public Object getAdapter(ISourceViewer viewer, Class required) { if (ProjectionAnnotationModel.class.equals(required)) { if (viewer instanceof ProjectionViewer) { ProjectionViewer projectionViewer = (ProjectionViewer) viewer; return projectionViewer.getProjectionAnnotationModel(); } } return null; }