Examples of IAnnotationModelExtension


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

     *
     * @param annotations
     */
    @Override
    public void addedAnnotation(Collection<AnnotationFS> annotations) {
      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Map<Annotation, Position> addAnnotationMap = new HashMap<Annotation, Position>();
     
      for (AnnotationFS annotation : annotations) {
        addAnnotationMap.put(new EclipseAnnotationPeer(annotation), new Position(annotation.getBegin(),
                annotation.getEnd() - annotation.getBegin()));
      }
     
      annotationModel.replaceAnnotations(null, addAnnotationMap);
    }
View Full Code Here

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

        mFeatureStructureSelectionProvider.clearSelectionSilently();
      }

      highlight(0, 0); // TODO: only if removed annotation was selected

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Annotation removeAnnotations[] = new Annotation[deletedAnnotations.size()];
      int removeAnnotationsIndex = 0;
      for (AnnotationFS annotation : deletedAnnotations) {
        removeAnnotations[removeAnnotationsIndex++] = new EclipseAnnotationPeer(annotation);
      }
     
      annotationModel.replaceAnnotations(removeAnnotations, null);
    }
View Full Code Here

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

     * @param annotations
     */
    @Override
    public void updatedAnnotation(Collection<AnnotationFS> annotations) {
     
      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      for (AnnotationFS annotation : annotations) {
        annotationModel.modifyAnnotationPosition(new EclipseAnnotationPeer(annotation),
                new Position(annotation.getBegin(), annotation.getEnd() - annotation.getBegin()));
      }
     
      selectionChanged(getSite().getPage().getActivePart(), mFeatureStructureSelectionProvider.getSelection());
    }
View Full Code Here

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

   * in this action's editor, if any.
   *
   * @return the diff model associated with the displayed document, or <code>null</code>
   */
  protected ILineDiffer getDiffer() {
    IAnnotationModelExtension extension= getModel();
    if (extension != null)
      return (ILineDiffer)extension.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
    return null;
  }
View Full Code Here

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

          REVISION_ASK_BEFORE_QUICKDIFF_SWITCH_KEY);
      if (toggleDialog.getReturnCode() != Window.OK)
        return false;
    }
   
    IAnnotationModelExtension modelExtension=(IAnnotationModelExtension) annotationModel;
    modelExtension.removeAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
   

    modelExtension.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, newDiffer);
   
    if (fDelegate instanceof IChangeRulerColumn)
      ((IChangeRulerColumn) fDelegate).setModel(annotationModel); // picks up the new model attachment
   
    return true;
View Full Code Here

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

    ISourceViewer viewer= fViewer;
    if (viewer == null)
      return null;
   
    IAnnotationModel m= viewer.getAnnotationModel();
    IAnnotationModelExtension model= null;
    if (m instanceof IAnnotationModelExtension)
      model= (IAnnotationModelExtension) m;
   
    IAnnotationModel differ= getDiffer();
    // create diff model if it doesn't
    if (differ == null) {
      IPreferenceStore store= getPreferenceStore();
      if (store != null) {
        String defaultId= store.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
        differ= new QuickDiff().createQuickDiffAnnotationModel(getEditor(), defaultId);
        if (differ != null) {
          if (model == null)
            model= new AnnotationModel();
          model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
        }
      }
    } else if (differ instanceof ILineDifferExtension2) {
      if (((ILineDifferExtension2) differ).isSuspended())
        ((ILineDifferExtension) differ).resume();
View Full Code Here

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

      m= ((IChangeRulerColumn)fDelegate).getModel();
   
    if (!(m instanceof IAnnotationModelExtension))
      return null;
   
    IAnnotationModelExtension model= (IAnnotationModelExtension)m;

    // get diff model if it exists already
    return model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
  }
View Full Code Here

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

    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;
    }

    // get differ
    DocumentLineDiffer differ= (DocumentLineDiffer)model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);

    // create if needed
    if (differ == null && createIfNeeded) {
      differ= new DocumentLineDiffer();
      model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
    }

    return differ;
  }
View Full Code Here

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

   * in this action's editor, if any.
   *
   * @return the diff model associated with the displayed document, or <code>null</code>
   */
  protected ILineDiffer getDiffer() {
    IAnnotationModelExtension extension= getModel();
    if (extension != null)
      return (ILineDiffer)extension.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
    return null;
  }
View Full Code Here

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

     *
     * @param annotations
     */
    @Override
    public void addedAnnotation(Collection<AnnotationFS> annotations) {
      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Map<Annotation, Position> addAnnotationMap = new HashMap<Annotation, Position>();
     
      for (AnnotationFS annotation : annotations) {
        addAnnotationMap.put(new EclipseAnnotationPeer(annotation), new Position(annotation.getBegin(),
                annotation.getEnd() - annotation.getBegin()));
      }
     
      annotationModel.replaceAnnotations(null, addAnnotationMap);
    }
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.