Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel


        // Obtain all markers in the editor
        IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class);
        IMarker[] allMarkers = MarkerUtil.getMarkers(resource, IResource.DEPTH_ZERO);
        // Discover relevant markers, i.e. FindBugsMarkers
        AbstractMarkerAnnotationModel model = getModel();
        IDocument document = getDocument();
        for (int i = 0; i < allMarkers.length; i++) {
            if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
                if (MarkerUtil.isFindBugsMarker(allMarkers[i])) {
                    markers.add(allMarkers[i]);
                }
            }
        }
View Full Code Here


  private void findJavaAnnotation() {
    fPosition = null;
    fAnnotation = null;
    fHasCorrection = false;

    AbstractMarkerAnnotationModel model = getAnnotationModel();
    IAnnotationAccessExtension annotationAccess = getAnnotationAccessExtension();

    IDocument document = getDocument();
    if (model == null)
      return;

    boolean hasAssistLightbulb = false;
    // fStore.getBoolean(RutaPreferenceConstants.EDITOR_QUICKASSIST_LIGHTBULB);

    Iterator iter = model.getAnnotationIterator();
    int layer = Integer.MIN_VALUE;

    while (iter.hasNext()) {
      Annotation annotation = (Annotation) iter.next();
      if (annotation.isMarkedDeleted())
        continue;

      int annotationLayer = layer;
      if (annotationAccess != null) {
        annotationLayer = annotationAccess.getLayer(annotation);
        if (annotationLayer < layer)
          continue;
      }

      Position position = model.getPosition(annotation);
      if (!includesRulerLine(position, document))
        continue;

      boolean isReadOnly = fTextEditor instanceof ITextEditorExtension
              && ((ITextEditorExtension) fTextEditor).isEditorInputReadOnly();
View Full Code Here

      } catch (BadLocationException e) {
      }
      if (lineNumber >= 0) {

        IResource resource = getResource(editor.getEditorInput());
        AbstractMarkerAnnotationModel model = getAnnotationModel(editor);
        IBreakpoint[] breakpoints = getBreakpoints(resource, document,
            model, lineNumber);
        if (breakpoints.length > 0) {
          IBreakpointManager breakpointManager = DebugPlugin
              .getDefault().getBreakpointManager();
View Full Code Here

  protected IMarker[] getMarkers(ITextEditor editor) {
    List markers = new ArrayList();

    IResource resource = getResource(editor.getEditorInput());
    IDocument document = getDocument(editor);
    AbstractMarkerAnnotationModel annotationModel = getAnnotationModel(editor);

    if (resource != null && annotationModel != null && resource.exists()) {
      try {
        IMarker[] allMarkers = resource.findMarkers(
            IBreakpoint.BREAKPOINT_MARKER, true,
            IResource.DEPTH_ZERO);
        if (allMarkers != null) {
          for (int i = 0; i < allMarkers.length; i++) {
            if (includesRulerLine(editor,
                annotationModel
                    .getMarkerPosition(allMarkers[i]),
                document)) {
              markers.add(allMarkers[i]);
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel

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.