Examples of IAnnotationModel


Examples of org.eclipse.jface.text.source.IAnnotationModel

      }
    }

    super.doResetDocument(element, monitor);

    IAnnotationModel model= getAnnotationModel(element);
    if (model instanceof AbstractMarkerAnnotationModel) {
      AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) model;
      markerModel.resetMarkers();
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

  protected void setUpSynchronization(FileInfo info) {
    if (info == null || info.fTextFileBuffer == null)
      return;
   
    IDocument document= info.fTextFileBuffer.getDocument();
    IAnnotationModel model= info.fModel;

    if (document instanceof ISynchronizable) {
      Object lock= ((ISynchronizable)document).getLockObject();
      if (lock == null) {
        lock= new Object();
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

  /*
   * @see org.eclipse.ui.texteditor.IVerticalRulerListener#annotationDefaultSelected(org.eclipse.ui.texteditor.VerticalRulerEvent)
   */
  public void annotationDefaultSelected(VerticalRulerEvent event) {
    Annotation a= event.getSelectedAnnotation();
    IAnnotationModel model= getAnnotationModel();
    Position position= model.getPosition(a);
    if (position == null)
      return;

    getTextEditor().selectAndReveal(position.offset, position.length);
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

    if (!(editor instanceof AbstractTextEditor)) {
      setEnabled(false);
      return;
    }
   
    IAnnotationModel model= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
    setEnabled(model != null);
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

    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())
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

    IDocumentProvider provider= fEditor.getDocumentProvider();
    IEditorInput editorInput= fEditor.getEditorInput();
    if (provider == null || editorInput == null)
      return null;

    IAnnotationModel m= provider.getAnnotationModel(editorInput);
    IAnnotationModelExtension model= null;
    if (m instanceof IAnnotationModelExtension) {
      model= (IAnnotationModelExtension)m;
    } else {
      return null;
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

  private IAnnotationModelExtension getModel() {
    if (getTextEditor() == null)
      return null;
    IDocumentProvider provider= getTextEditor().getDocumentProvider();
    IEditorInput editorInput= getTextEditor().getEditorInput();
    IAnnotationModel m= provider.getAnnotationModel(editorInput);
    if (m instanceof IAnnotationModelExtension)
      return (IAnnotationModelExtension)m;
    return null;
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

   *
   * @param input the editor input to be used to initialize the source viewer
   */
  private void initializeSourceViewer(IEditorInput input) {

    IAnnotationModel model= getDocumentProvider().getAnnotationModel(input);
    IDocument document= getDocumentProvider().getDocument(input);

    if (document != null) {
      fSourceViewer.setDocument(document, model);
      fSourceViewer.setEditable(isEditable());
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

    IDocument document= getDocumentProvider().getDocument(getEditorInput());
    int endOfDocument= document.getLength();
    int distance= Integer.MAX_VALUE;

    IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput());
    Iterator e= model.getAnnotationIterator();
    while (e.hasNext()) {
      Annotation a= (Annotation) e.next();
      if (!isNavigationTarget(a))
        continue;

      Position p= model.getPosition(a);
      if (p == null)
        continue;

      if (forward && p.offset == offset || !forward && p.offset + p.getLength() == offset + length) {// || p.includes(offset)) {
        if (containingAnnotation == null || (forward && p.length >= containingAnnotationPosition.length || !forward && p.length >= containingAnnotationPosition.length)) {
View Full Code Here

Examples of org.eclipse.jface.text.source.IAnnotationModel

 
    IEditorInput editorInput= editor.getEditorInput();
    if (editorInput == null)
      return;
   
    IAnnotationModel model= documentProvider.getAnnotationModel(editorInput);
    if (model == null)
      return;
   
    IDocument document= documentProvider.getDocument(editorInput);
    if (document == null)
      return;
 
    boolean supportsBatchReplace= (model instanceof IAnnotationModelExtension);
    List toBeRemovedAnnotations= new ArrayList();
    Iterator iter= model.getAnnotationIterator();
    while (iter.hasNext()) {
      Annotation annotation= (Annotation) iter.next();
      if (SpellingAnnotation.TYPE.equals(annotation.getType())) {
        boolean doRemove= word == null;
        if (word == null)
          doRemove= true;
        else {
          String annotationWord= null;
          Position pos= model.getPosition(annotation);
          try {
            annotationWord= document.get(pos.getOffset(), pos.getLength());
          } catch (BadLocationException e) {
            continue;
          }
          doRemove= word.equals(annotationWord);
        }
        if (doRemove) {
          if (supportsBatchReplace)
            toBeRemovedAnnotations.add(annotation);
          else
            model.removeAnnotation(annotation);
        }
      }
    }
 
    if (supportsBatchReplace && !toBeRemovedAnnotations.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.