Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel


  private void checkReadOnly() {
    fPosition = null;
    fIsEditable = false;

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

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

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

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

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

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

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


    super.doResetDocument(element, monitor);

    IAnnotationModel model= getAnnotationModel(element);
    if (model instanceof AbstractMarkerAnnotationModel) {
      AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) model;
      markerModel.resetMarkers();
    }
  }
View Full Code Here

         */
        protected void execute(IProgressMonitor monitor) throws CoreException {
          info.fTextFileBuffer.revert(monitor);

          if (info.fModel instanceof AbstractMarkerAnnotationModel) {
            AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) info.fModel;
            markerModel.resetMarkers();
          }
        }
        /*
         * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
         */
 
View Full Code Here

        info.fTextFileBuffer.setDirty(true);
    }
   
    info.fTextFileBuffer.commit(monitor, overwrite);
    if (info.fModel instanceof AbstractMarkerAnnotationModel) {
      AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel;
      model.updateMarkers(info.fTextFileBuffer.getDocument());
    }
  }
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

      if (lineNumber >= 0) {
        ToggleBreakpointAction toggler = new ToggleBreakpointAction(editor, null);
        toggler.update();
        if (toggler.isEnabled()) {
          IResource resource = toggler.getResource();
          AbstractMarkerAnnotationModel model = toggler.getAnnotationModel();
          IBreakpoint[] breakpoints = getBreakpoints(resource, document, model, lineNumber);
          if (breakpoints.length > 0) {
            IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
            for (int i = 0; i < breakpoints.length; i++) {
              breakpoints[i].getMarker().delete();
View Full Code Here

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

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

    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(annotationModel.getMarkerPosition(allMarkers[i]), document)) {
              markers.add(allMarkers[i]);
            }
          }
        }
      } catch (CoreException x) {
View Full Code Here

  }

  protected boolean hasMarkers() {
    IResource resource = getResource();
    IDocument document = getDocument();
    AbstractMarkerAnnotationModel model = getAnnotationModel();

    if (resource != null && model != null && resource.exists()) {
      try {
        IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
        if (allMarkers != null) {
          for (int i = 0; i < allMarkers.length; i++) {
            if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
              return true;
            }
          }
        }
      } catch (CoreException x) {
View Full Code Here

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

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

    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(annotationModel.getMarkerPosition(allMarkers[i]), document)) {
              markers.add(allMarkers[i]);
            }
          }
        }
      } catch (CoreException x) {
View Full Code Here

  }

  protected boolean hasMarkers() {
    IResource resource = getResource();
    IDocument document = getDocument();
    AbstractMarkerAnnotationModel model = getAnnotationModel();

    if (resource != null && model != null && resource.exists()) {
      try {
        IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
        if (allMarkers != null) {
          for (int i = 0; i < allMarkers.length; i++) {
            if (includesRulerLine(model.getMarkerPosition(allMarkers[i]), document)) {
              return true;
            }
          }
        }
      } catch (CoreException x) {
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.