Codota Logo
IAnnotationModelExtension
Code IndexAdd Codota to your IDE (free)

How to use
IAnnotationModelExtension
in
org.eclipse.jface.text.source

Best Java code snippets using org.eclipse.jface.text.source.IAnnotationModelExtension (Showing top 20 results out of 315)

  • Common ways to obtain IAnnotationModelExtension
private void myMethod () {
IAnnotationModelExtension i =
  • Codota Iconnew AnnotationModel()
  • Smart code suggestions by Codota
}
origin: org.eclipse.platform/org.eclipse.search

private void addAnnotations(Map<Annotation, Position> annotationToPositionMap) {
  if (fModel instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension ame= (IAnnotationModelExtension) fModel;
    ame.replaceAnnotations(new Annotation[0], annotationToPositionMap);
  } else {
    Set<Entry<Annotation, Position>> entrySet = annotationToPositionMap.entrySet();
    for (Entry<Annotation, Position> entry : entrySet) {
      fModel.addAnnotation(entry.getKey(), entry.getValue());
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * 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;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public IAnnotationModel getAnnotationModel() {
  if (fVisualAnnotationModel instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel;
    return extension.getAnnotationModel(MODEL_ANNOTATION_MODEL);
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.jface.text

private void ensureAnnotationModelInstalled() {
  LinkedPositionAnnotations lpa= fCurrentTarget.fAnnotationModel;
  if (lpa != null) {
    ITextViewer viewer= fCurrentTarget.getViewer();
    if (viewer instanceof ISourceViewer) {
      ISourceViewer sv= (ISourceViewer) viewer;
      IAnnotationModel model= sv.getAnnotationModel();
      if (model instanceof IAnnotationModelExtension) {
        IAnnotationModelExtension ext= (IAnnotationModelExtension) model;
        IAnnotationModel ourModel= ext.getAnnotationModel(getUniqueKey());
        if (ourModel == null) {
          ext.addAnnotationModel(getUniqueKey(), lpa);
        }
      }
    }
  }
}
origin: org.apache.uima/uimaj-ep-cas-editor

/**
 * Sync annotations.
 */
private void syncAnnotations() {
 
 removeAllAnnotations();
 
 // Remove all annotation from the model
 IAnnotationModel annotationModel = getDocumentProvider().getAnnotationModel(getEditorInput());
 ((IAnnotationModelExtension) annotationModel).removeAllAnnotations();
 
 // Add all annotation to the model
 // copy annotations into annotation model
 final Iterator<AnnotationFS> mAnnotations = getDocument().getCAS().getAnnotationIndex()
     .iterator();
 
 // TODO: Build first a map, and then pass all annotations at once
 Map annotationsToAdd = new HashMap();
 
 while (mAnnotations.hasNext()) {
  AnnotationFS annotationFS = mAnnotations.next();
  annotationsToAdd.put(new EclipseAnnotationPeer(annotationFS), new Position(
      annotationFS.getBegin(), annotationFS.getEnd() - annotationFS.getBegin()));
 }
 
 ((IAnnotationModelExtension) annotationModel).replaceAnnotations(null, annotationsToAdd);
}
 
origin: org.eclipse/org.eclipse.ui.editors

modelExtension.removeAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
modelExtension.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, newDiffer);
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Removes the projection annotation model from the given annotation model.
 *
 * @param model the mode from which the projection annotation model is removed
 * @return the removed projection annotation model or <code>null</code> if there was none
 */
private IAnnotationModel removeProjectionAnnotationModel(IAnnotationModel model) {
  if (model instanceof IAnnotationModelExtension) {
    model.removeAnnotationModelListener(fAnnotationModelListener);
    IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
    return extension.removeAnnotationModel(ProjectionSupport.PROJECTION);
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void setRangeIndication(int start, int length, boolean moveCursor) {
  if (moveCursor) {
    setSelectedRange(start, 0);
    revealRange(start, length);
  }
  if (fRangeIndicator != null && fVisualAnnotationModel instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel;
    extension.modifyAnnotationPosition(fRangeIndicator, new Position(start, length));
  }
}
origin: org.apache.uima/uimaj-ep-cas-editor

/**
 * Removes the all annotations.
 */
private void removeAllAnnotations() {
 // Remove all annotation from the model
 IAnnotationModel annotationModel = getDocumentProvider().getAnnotationModel(getEditorInput());
 ((IAnnotationModelExtension) annotationModel).removeAllAnnotations();
}
 
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

private void ensureAnnotationModelInstalled() {
  LinkedPositionAnnotations lpa= fCurrentTarget.fAnnotationModel;
  if (lpa != null) {
    ITextViewer viewer= fCurrentTarget.getViewer();
    if (viewer instanceof ISourceViewer) {
      ISourceViewer sv= (ISourceViewer) viewer;
      IAnnotationModel model= sv.getAnnotationModel();
      if (model instanceof IAnnotationModelExtension) {
        IAnnotationModelExtension ext= (IAnnotationModelExtension) model;
        IAnnotationModel ourModel= ext.getAnnotationModel(getUniqueKey());
        if (ourModel == null) {
          ext.addAnnotationModel(getUniqueKey(), lpa);
        }
      }
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.editors

modelExtension.removeAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
modelExtension.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, newDiffer);
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Removes the projection annotation model from the given annotation model.
 *
 * @param model the mode from which the projection annotation model is removed
 * @return the removed projection annotation model or <code>null</code> if there was none
 */
private IAnnotationModel removeProjectionAnnotationModel(IAnnotationModel model) {
  if (model instanceof IAnnotationModelExtension) {
    model.removeAnnotationModelListener(fAnnotationModelListener);
    IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
    return extension.removeAnnotationModel(ProjectionSupport.PROJECTION);
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void setRangeIndication(int start, int length, boolean moveCursor) {
  if (moveCursor) {
    setSelectedRange(start, 0);
    revealRange(start, length);
  }
  if (fRangeIndicator != null && fVisualAnnotationModel instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel;
    extension.modifyAnnotationPosition(fRangeIndicator, new Position(start, length));
  }
}
origin: org.apache.directory.studio/ldifeditor

( ( IAnnotationModelExtension ) annotationModel ).removeAllAnnotations();
origin: org.eclipse/org.eclipse.search

private void removeAnnotations(IAnnotationModel model, Set annotations) {
  if (model instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension ame= (IAnnotationModelExtension) model;
    Annotation[] annotationArray= new Annotation[annotations.size()];
    ame.replaceAnnotations((Annotation[]) annotations.toArray(annotationArray), Collections.EMPTY_MAP);
  } else {
    for (Iterator iter= annotations.iterator(); iter.hasNext();) {
      Annotation element= (Annotation) iter.next();
      model.removeAnnotation(element);
    }
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public IAnnotationModel getAnnotationModel() {
  if (fVisualAnnotationModel instanceof IAnnotationModelExtension) {
    IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel;
    return extension.getAnnotationModel(MODEL_ANNOTATION_MODEL);
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

DocumentLineDiffer differ= (DocumentLineDiffer)model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
  model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * 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);
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

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());
    }
  }
}
origin: org.eclipse.xtext/ui

protected void announceAnnotationChanged(Annotation annotation) {
  if (annotationModel instanceof XtextResourceMarkerAnnotationModel)
    ((XtextResourceMarkerAnnotationModel) annotationModel).fireAnnotationChangedEvent(annotation);
  else {
    Position position = annotationModel.getPosition(annotation);
    if (annotationModel instanceof IAnnotationModelExtension)
      ((IAnnotationModelExtension) annotationModel).modifyAnnotationPosition(annotation, position);
    else {
      annotationModel.removeAnnotation(annotation);
      annotationModel.addAnnotation(annotation, position);
    }
  }
}
org.eclipse.jface.text.sourceIAnnotationModelExtension

Javadoc

Extends org.eclipse.jface.text.source.IAnnotationModelwith the ability piggyback other annotation models. It also introduces the concept of modification time stamps and adds methods for richer manipulation methods.

Most used methods

  • replaceAnnotations
    Adds and removes annotations to/from this annotation model in a single step. The annotations to remo
  • addAnnotationModel
    Attaches attachment to the receiver. Connectsattachment to the currently connected document. Ifattac
  • getAnnotationModel
    Returns the attached IAnnotationModel for key, or null if none is attached for key.
  • removeAnnotationModel
    Removes and returns the attached IAnnotationModel forkey.
  • modifyAnnotationPosition
    Modifies the position associated with the given annotation to equal the given position. If the annot
  • removeAllAnnotations
    Removes all annotations from this annotation model.
  • getModificationStamp
    Returns the modification stamp of this annotation model.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JComboBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now