Java 类org.eclipse.jface.text.source.IAnnotationModelListener 实例源码

项目:eclemma    文件:CoverageAnnotationModel.java   
private void fireModelChanged(AnnotationModelEvent event) {
  event.markSealed();
  if (!event.isEmpty()) {
    for (final IAnnotationModelListener l : annotationModelListeners) {
      if (l instanceof IAnnotationModelListenerExtension) {
        ((IAnnotationModelListenerExtension) l).modelChanged(event);
      } else {
        l.modelChanged(this);
      }
    }
  }
}
项目:CooperateModelingEnvironment    文件:CooperateCDOXtextDocumentProvider.java   
@Override
public IAnnotationModel createAnnotationModel(Object element) {
    IAnnotationModel annotationModel = super.createAnnotationModel(element);
    IAnnotationModelListener listener = annotationModelListeners.get(element);
    if (listener != null) {
        annotationModel.addAnnotationModelListener(listener);
    }
    return annotationModel;
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
/**
 * @see IAnnotationModelListener#modelChanged(IAnnotationModel)
 */
public void modelChanged(IAnnotationModel model) {
    Object[] listeners= fListenerList.getListeners();
    for (int i= 0; i < listeners.length; i++) {
        ((IAnnotationModelListener) listeners[i]).modelChanged(model);
    }
}
项目:EASyProducer    文件:EmbeddedXtextSourceEditor.java   
/**
 * Creates an editor representation instance.
 * 
 * @param embeddedEditor the embedded editor
 * @param viewer the underlying source viewer
 * @param partialEditorModelAccess the model access
 * @param requireWorkspaceResource whether the editor requires a workspace resource and shall complain at least in 
 *   the logs or whether it shall be silent
 */
public EmbeddedXtextSourceEditor(EmbeddedEditor embeddedEditor, XtextSourceViewer viewer, 
    EmbeddedEditorModelAccess partialEditorModelAccess, boolean requireWorkspaceResource) {
    this.embeddedEditor = embeddedEditor;
    this.viewer = viewer;
    this.partialEditorModelAccess = partialEditorModelAccess;

    try {
        URI uri = embeddedEditor.getDocument().getResourceURI();
        java.net.URI netURI = new java.net.URI(uri.toString());
        IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(netURI);
        if (null != files && files.length > 0) {
            resource = files[0];
        } else {
            if (requireWorkspaceResource) {
                getLogger().error("No resource for " + uri);
            }
        }
    } catch (URISyntaxException e) {
        getLogger().exception(e);
    }

    viewer.getAnnotationModel().addAnnotationModelListener(new IAnnotationModelListener() {

        @Override
        public void modelChanged(IAnnotationModel model) {
            if (!skipNextUpdateEvent) { // loading / updating the model
                dirty = true;
            }
            skipNextUpdateEvent = false;
        }
    });
}
项目:EASyProducer    文件:EmbeddedXtextSourceEditor.java   
@Override
public void addValidationStateListener(IValidationStateListener listener) {
    if (null != listener) {
        IAnnotationModelListener delegatingListener = new ValidationStateListener(listener);
        validationStateListeners.put(listener, delegatingListener);
        viewer.getAnnotationModel().addAnnotationModelListener(delegatingListener);
    }
}
项目:EASyProducer    文件:EmbeddedXtextSourceEditor.java   
@Override
public void removeValidationStateListener(IValidationStateListener listener) {
    if (null != listener) {
        IAnnotationModelListener delegatingListener =  validationStateListeners.remove(listener);
        if (null != delegatingListener && null != viewer) {
            IAnnotationModel model = viewer.getAnnotationModel();
            if (null != model) {
                model.removeAnnotationModelListener(delegatingListener);
            }
        }
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitDocumentProvider.java   
/**
 * @see IAnnotationModelListener#modelChanged(IAnnotationModel)
 */
public void modelChanged(IAnnotationModel model) {
    Object[] listeners= fListenerList.getListeners();
    for (int i= 0; i < listeners.length; i++) {
        ((IAnnotationModelListener) listeners[i]).modelChanged(model);
    }
}
项目:eclemma    文件:CoverageAnnotationModel.java   
public void addAnnotationModelListener(IAnnotationModelListener listener) {
  if (!annotationModelListeners.contains(listener)) {
    annotationModelListeners.add(listener);
    fireModelChanged(new AnnotationModelEvent(this, true));
  }
}
项目:eclemma    文件:CoverageAnnotationModel.java   
public void removeAnnotationModelListener(IAnnotationModelListener listener) {
  annotationModelListeners.remove(listener);
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
public void addListener(IAnnotationModelListener listener) {
    fListenerList.add(listener);
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
public void removeListener(IAnnotationModelListener listener) {
    fListenerList.remove(listener);
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
public void addGlobalAnnotationModelListener(IAnnotationModelListener listener) {
    fGlobalAnnotationModelListener.addListener(listener);
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
public void removeGlobalAnnotationModelListener(IAnnotationModelListener listener) {
    fGlobalAnnotationModelListener.removeListener(listener);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitDocumentProvider.java   
public void addListener(IAnnotationModelListener listener) {
    fListenerList.add(listener);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitDocumentProvider.java   
public void removeListener(IAnnotationModelListener listener) {
    fListenerList.remove(listener);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitDocumentProvider.java   
public void addGlobalAnnotationModelListener(IAnnotationModelListener listener) {
    fGlobalAnnotationModelListener.addListener(listener);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitDocumentProvider.java   
public void removeGlobalAnnotationModelListener(IAnnotationModelListener listener) {
    fGlobalAnnotationModelListener.removeListener(listener);
}
项目:Eclipse-Postfix-Code-Completion    文件:ICompilationUnitDocumentProvider.java   
/**
 * Adds a listener that reports changes from all compilation unit annotation models.
 *
 * @param listener the listener
 */
void addGlobalAnnotationModelListener(IAnnotationModelListener listener);
项目:Eclipse-Postfix-Code-Completion    文件:ICompilationUnitDocumentProvider.java   
/**
 * Removes the listener.
 *
 * @param listener the listener
 */
void removeGlobalAnnotationModelListener(IAnnotationModelListener listener);
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ICompilationUnitDocumentProvider.java   
/**
 * Adds a listener that reports changes from all compilation unit annotation models.
 *
 * @param listener the listener
 */
void addGlobalAnnotationModelListener(IAnnotationModelListener listener);
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ICompilationUnitDocumentProvider.java   
/**
 * Removes the listener.
 *
 * @param listener the listener
 */
void removeGlobalAnnotationModelListener(IAnnotationModelListener listener);