@Override protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { return new org.eclipse.jface.text.source.AnnotationModel(); }
protected AnnotationModel createAnnotationModel() { return new AnnotationModel(); }
EntityModel model = new AnnotationModel(); model.registerClass(SampleValuesProxy.class);
/** * 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; }
/** * 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; }
/** * 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 */ @SuppressWarnings("static-method") protected IAnnotationModel createVisualAnnotationModel(IAnnotationModel annotationModel) { IAnnotationModelExtension model= new AnnotationModel(); model.addAnnotationModel(MODEL_ANNOTATION_MODEL, annotationModel); return (IAnnotationModel) model; }
@Override public IAnnotationModel createAnnotationModel(IPath path) { IResource file= ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (file instanceof IFile) return new CompilationUnitAnnotationModel(file); return new AnnotationModel(); }
@Override public IAnnotationModel createAnnotationModel(IPath path) { IResource file= ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (file instanceof IFile) return new CompilationUnitAnnotationModel(file); return new AnnotationModel(); }
public IAnnotationModel createAnnotationModel(IPath location) { IFile file= FileBuffers.getWorkspaceFileAtLocation(location); if (file != null) return new ResourceMarkerAnnotationModel(file); return new AnnotationModel(); } }
@Override protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { if (element instanceof IAdaptable) { IFile file = (IFile) ((IAdaptable) element).getAdapter(IFile.class); if (file != null) { return new ResourceMarkerAnnotationModel(file); } } return new AnnotationModel(); }
@Override public IAnnotationModel createAnnotationModel(IPath location) { IFile file= FileBuffers.getWorkspaceFileAtLocation(location); if (file != null) return new ResourceMarkerAnnotationModel(file); return new AnnotationModel(); } }
@Override protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { if (element instanceof IFileEditorInput) { IFileEditorInput input = (IFileEditorInput) element; return new XtextResourceMarkerAnnotationModel(input.getFile(), issueResolutionProvider, issueUtil); } else if (element instanceof IURIEditorInput) { return new AnnotationModel(); } return super.createAnnotationModel(element); }
@Override public void connect(Object element) throws CoreException { super.connect(element); if (getFileInfo(element) != null) return; CompilationUnitInfo info= fFakeCUMapForMissingInfo.get(element); if (info == null) { ICompilationUnit cu= createFakeCompiltationUnit(element, true); if (cu == null) return; info= new CompilationUnitInfo(); info.fCopy= cu; info.fElement= element; info.fModel= new AnnotationModel(); fFakeCUMapForMissingInfo.put(element, info); } info.fCount++; }
public void connect(Object element) throws CoreException { super.connect(element); if (getFileInfo(element) != null) return; CompilationUnitInfo info= (CompilationUnitInfo)fFakeCUMapForMissingInfo.get(element); if (info == null) { ICompilationUnit cu= createFakeCompiltationUnit(element, true); if (cu == null) return; info= new CompilationUnitInfo(); info.fCopy= cu; info.fElement= element; info.fModel= new AnnotationModel(); fFakeCUMapForMissingInfo.put(element, info); } info.fCount++; }
@Override public void connect(Object element) throws CoreException { super.connect(element); if (getFileInfo(element) != null) return; CompilationUnitInfo info= fFakeCUMapForMissingInfo.get(element); if (info == null) { ICompilationUnit cu= createFakeCompiltationUnit(element, true); if (cu == null) return; info= new CompilationUnitInfo(); info.fCopy= cu; info.fElement= element; info.fModel= new AnnotationModel(); fFakeCUMapForMissingInfo.put(element, info); } info.fCount++; }
protected void setModel(XtextDocument document, String prefix, String editablePart, String suffix) { if (this.insertLineBreaks) { String delimiter = document.getDefaultLineDelimiter(); prefix = prefix + delimiter; suffix = delimiter + suffix; } String model = prefix + editablePart + suffix; document.set(model); XtextResource resource = createResource(model); document.setInput(resource); AnnotationModel annotationModel = new AnnotationModel(); if (document instanceof ISynchronizable) { Object lock = ((ISynchronizable) document).getLockObject(); if (lock == null) { lock = new Object(); ((ISynchronizable) document).setLockObject(lock); } ((ISynchronizable) annotationModel).setLockObject(lock); } this.viewer.setDocument(document, annotationModel, prefix.length(), editablePart.length()); }
/** Configures annotation model for spell checking. */ private void configureAsEditor(ISourceViewer viewer, Document document) { IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess(); final SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(viewer, null, annotationAccess, EditorsUI.getSharedTextColors()); Iterator<?> e = new MarkerAnnotationPreferences().getAnnotationPreferences().iterator(); while (e.hasNext()) { support.setAnnotationPreference((AnnotationPreference) e.next()); } support.install(EditorsUI.getPreferenceStore()); viewer.getTextWidget().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { support.uninstall(); } }); AnnotationModel annotationModel = new AnnotationModel(); viewer.setDocument(document, annotationModel); }
public void setMarkup(String source) { try { String htmlText = computeHtml(source); setHtml(htmlText); } catch (Throwable t) { if (getTextPresentation() != null) { getTextPresentation().clear(); } setDocumentNoMarkup(new Document(source), new AnnotationModel()); if (WikiTextUiPlugin.getDefault() != null) { WikiTextUiPlugin.getDefault().log(IStatus.ERROR, Messages.MarkupViewer_parseFailure, t); } else { t.printStackTrace(); } } }
parser.setDefaultFont(getTextWidget().getFont()); parser.setDefaultMonospaceFont(defaultMonospaceFont); result.annotationModel = new AnnotationModel(); parser.setAnnotationModel(result.annotationModel);
/** * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument) */ public void setDocument( IDocument document ) { if ( sourceViewer.getAnnotationModel() == null ) { IAnnotationModel model = new AnnotationModel(); sourceViewer.setDocument( sourceViewer.getDocument(), model ); } // add annotation painter if ( paintManager == null && sourceViewer.getAnnotationModel() instanceof IAnnotationModelExtension ) { AnnotationPainter ap = new AnnotationPainter( sourceViewer, null ); ap.addAnnotationType( "DEFAULT" ); //$NON-NLS-1$ ap.setAnnotationTypeColor( "DEFAULT", BrowserCommonActivator.getDefault().getColor( new RGB( 255, 0, 0 ) ) ); //$NON-NLS-1$ sourceViewer.getAnnotationModel().addAnnotationModelListener( ap ); FilterCharacterPairMatcher cpm = new FilterCharacterPairMatcher( sourceViewer, parser ); MatchingCharacterPainter mcp = new MatchingCharacterPainter( sourceViewer, cpm ); mcp.setColor( BrowserCommonActivator.getDefault().getColor( new RGB( 159, 159, 159 ) ) ); paintManager = new PaintManager( sourceViewer ); paintManager.addPainter( ap ); paintManager.addPainter( mcp ); } }