Package org.eclipse.jface.text.source

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


   *
   * @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);
    }
  }
View Full Code Here


   * @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;
  }
View Full Code Here

   * @return the projection annotation model
   */
  public ProjectionAnnotationModel getProjectionAnnotationModel() {
    IAnnotationModel model= getVisualAnnotationModel();
    if (model instanceof IAnnotationModelExtension) {
      IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
      return (ProjectionAnnotationModel) extension.getAnnotationModel(ProjectionSupport.PROJECTION);
    }
    return null;
  }
View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.AnnotationRulerColumn#setModel(org.eclipse.jface.text.source.IAnnotationModel)
   */
  public void setModel(IAnnotationModel model) {
    if (model instanceof IAnnotationModelExtension) {
      IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
      model= extension.getAnnotationModel(ProjectionSupport.PROJECTION);
    }
    super.setModel(model);
  }
View Full Code Here

            IAnnotationModel model = provider.getAnnotationModel(edit.getEditorInput());
            if (model == null) {
                return;
            }

            IAnnotationModelExtension modelExtension = (IAnnotationModelExtension) model;

            List<Annotation> existing = new ArrayList<Annotation>();
            Iterator<Annotation> it = model.getAnnotationIterator();
            if (it == null) {
                return;
            }
            while (it.hasNext()) {
                existing.add(it.next());
            }

            IDocument doc = edit.getDocument();
            IResource resource = AbstractBreakpointRulerAction.getResourceForDebugMarkers(edit);
            IEditorInput externalFileEditorInput = AbstractBreakpointRulerAction.getExternalFileEditorInput(edit);
            List<IMarker> markers = AbstractBreakpointRulerAction.getMarkersFromEditorResource(resource, doc,
                    externalFileEditorInput, 0, false, model);

            Map<Annotation, Position> annotationsToAdd = new HashMap<Annotation, Position>();
            for (IMarker m : markers) {
                Position pos = AbstractBreakpointRulerAction.getMarkerPosition(doc, m, model);
                MarkerAnnotation newAnnotation = new MarkerAnnotation(m);
                annotationsToAdd.put(newAnnotation, pos);
            }

            //update all in a single step
            modelExtension.replaceAnnotations(existing.toArray(new Annotation[0]), annotationsToAdd);
        }
View Full Code Here

            //on it on a minimum priority thread is not a good thing.
            thread.setPriority(Thread.NORM_PRIORITY);

            synchronized (getLockObject(annotationModel)) {
                //replace them
                IAnnotationModelExtension ext = (IAnnotationModelExtension) annotationModel;
                ext.replaceAnnotations(toRemove.toArray(new Annotation[0]), toAddAsMap);
            }

        } finally {
            thread.setPriority(initiaThreadlPriority);
        }
View Full Code Here

   *
   * @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);
    }
  }
View Full Code Here

   * @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;
  }
View Full Code Here

   * @return the projection annotation model
   */
  public ProjectionAnnotationModel getProjectionAnnotationModel() {
    IAnnotationModel model= getVisualAnnotationModel();
    if (model instanceof IAnnotationModelExtension) {
      IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
      return (ProjectionAnnotationModel) extension.getAnnotationModel(ProjectionSupport.PROJECTION);
    }
    return null;
  }
View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.AnnotationRulerColumn#setModel(org.eclipse.jface.text.source.IAnnotationModel)
   */
  public void setModel(IAnnotationModel model) {
    if (model instanceof IAnnotationModelExtension) {
      IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
      model= extension.getAnnotationModel(ProjectionSupport.PROJECTION);
    }
    super.setModel(model);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.IAnnotationModelExtension

Copyright © 2018 www.massapicom. 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.