Codota Logo
Annotation
Code IndexAdd Codota to your IDE (free)

How to use
Annotation
in
org.eclipse.jface.text.source

Best Java code snippets using org.eclipse.jface.text.source.Annotation (Showing top 20 results out of 315)

  • Common ways to obtain Annotation
private void myMethod () {
Annotation a =
  • Codota IconIterator iter;(Annotation) iter.next()
  • Codota IconString type;new Annotation(type, true, null)
  • Codota IconVerticalRulerEvent verticalRulerEvent;verticalRulerEvent.getSelectedAnnotation()
  • Smart code suggestions by Codota
}
origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

@Override
public boolean canFix(Annotation annotation) {
  return annotation instanceof SpellingAnnotation && !annotation.isMarkedDeleted();
}
origin: org.eclipse.mylyn.wikitext/ui

public Object getType(Annotation annotation) {
  return annotation.getType();
}
origin: org.eclipse.xtext/ui

@Override
protected Object getHoverInfoInternal(final ITextViewer textViewer, final int lineNumber, final int offset) {
  final Set<String> messages = Sets.newLinkedHashSet();
  List<Annotation> annotations = getAnnotations(lineNumber, offset);
  for (Annotation annotation : annotations) {
    if (annotation.getText() != null) {
      messages.add(annotation.getText().trim());
    }
  }
  if (messages.size()>0)
    return formatInfo(messages);
  return null;
}

origin: org.eclipse.xtext/ui

/**
 * @since 2.1
 */
protected boolean isHandled(Annotation annotation) {
  return null != annotation
      && !annotation.isMarkedDeleted()
      && (markerAnnotationAccess.isSubtype(annotation.getType(), "org.eclipse.ui.workbench.texteditor.error") 
          || markerAnnotationAccess.isSubtype(annotation.getType(), "org.eclipse.ui.workbench.texteditor.warning")
          || markerAnnotationAccess.isSubtype(annotation.getType(), "org.eclipse.ui.workbench.texteditor.info")
          || markerAnnotationAccess.isSubtype(annotation.getType(), "org.eclipse.ui.workbench.texteditor.bookmark")
          || markerAnnotationAccess.isSubtype(annotation.getType(), "org.eclipse.ui.workbench.texteditor.spelling"));
}
origin: org.eclipse.platform/org.eclipse.jface.text

private void skip() {
  boolean temp= (fStyle & TEMPORARY) != 0;
  boolean pers= (fStyle & PERSISTENT) != 0;
  boolean ignr= (fStyle & IGNORE_BAGS) != 0;
  while (fIterator.hasNext()) {
    Annotation next= fIterator.next();
    if (next.isMarkedDeleted())
      continue;
    if (ignr && (next instanceof AnnotationBag))
      continue;
    fNext= next;
    Object annotationType= next.getType();
    if (fType == null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) {
      if (temp && pers) return;
      if (pers && next.isPersistent()) return;
      if (temp && !next.isPersistent()) return;
    }
  }
  fNext= null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  toRemove.remove(fTargetAnnotations.get(p));
} else {
  Annotation a= new Annotation(TARGET_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$
  toAdd.put(a, p);
  fTargetAnnotations.put(p, a);
origin: org.eclipse/org.eclipse.ui.editors

public boolean isTemporary(Annotation annotation) {
  return !annotation.isPersistent();
}
origin: org.eclipse/org.eclipse.jdt.ui

private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) {
  Annotation annotation= new Annotation(annotationType, false, null);
  AnnotationPreference preference= lookup.getAnnotationPreference(annotation);
  if (preference != null)
    return preference.getPresentationLayer() + 1;
  else
    return IAnnotationAccessExtension.DEFAULT_LAYER + 1;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

private void cacheAnnotations() {
  fCachedAnnotations.clear();
  if (fModel != null) {
    Iterator<Annotation> iter= fModel.getAnnotationIterator();
    while (iter.hasNext()) {
      Annotation annotation= iter.next();
      if (annotation.isMarkedDeleted())
        continue;
      if (skip(annotation.getType()))
        continue;
      fCachedAnnotations.add(annotation);
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

private void skip() {
  boolean temp= (fStyle & TEMPORARY) != 0;
  boolean pers= (fStyle & PERSISTENT) != 0;
  boolean ignr= (fStyle & IGNORE_BAGS) != 0;
  while (fIterator.hasNext()) {
    Annotation next= fIterator.next();
    if (next.isMarkedDeleted())
      continue;
    if (ignr && (next instanceof AnnotationBag))
      continue;
    fNext= next;
    Object annotationType= next.getType();
    if (fType == null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) {
      if (temp && pers) return;
      if (pers && next.isPersistent()) return;
      if (temp && !next.isPersistent()) return;
    }
  }
  fNext= null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.editors

/**
 * {@inheritDoc}
 *
 * @deprecated assumed to always return <code>true</code>
 */
@Deprecated
@Override
public boolean isTemporary(Annotation annotation) {
  return !annotation.isPersistent();
}
origin: org.eclipse/org.eclipse.ajdt.ui

public static boolean isQuickFixableType(Annotation annotation) {
  return (annotation instanceof IJavaAnnotation || annotation instanceof SimpleMarkerAnnotation) && !annotation.isMarkedDeleted();
}
origin: org.eclipse/org.eclipse.ui.editors

public Object getType(Annotation annotation) {
  return annotation.getType();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) {
  Annotation annotation= new Annotation(annotationType, false, null);
  AnnotationPreference preference= lookup.getAnnotationPreference(annotation);
  if (preference != null)
    return preference.getPresentationLayer() + 1;
  else
    return IAnnotationAccessExtension.DEFAULT_LAYER + 1;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
protected void computeInformation() {
  if (fSelection != null) {
    Rectangle subjectArea= fSelection.canvas.getBounds();
    Annotation annotation= fSelection.fAnnotation;
    String msg;
    if (annotation != null)
      msg= annotation.getText();
    else
      msg= null;
    setInformation(msg, subjectArea);
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

private void cacheAnnotations() {
  fCachedAnnotations.clear();
  if (fModel != null) {
    Iterator<Annotation> iter= fModel.getAnnotationIterator();
    while (iter.hasNext()) {
      Annotation annotation= iter.next();
      if (annotation.isMarkedDeleted())
        continue;
      if (skip(annotation.getType()))
        continue;
      fCachedAnnotations.add(annotation);
    }
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

public static boolean isQuickFixableType(Annotation annotation) {
  return (annotation instanceof IJavaAnnotation || annotation instanceof SimpleMarkerAnnotation) && !annotation.isMarkedDeleted();
}
origin: org.eclipse/org.eclipse.jdt.ui

  private boolean isBreakpointAnnotation(Annotation a) {
    // HACK to get breakpoints to show up first
    return a.getType().equals("org.eclipse.debug.core.breakpoint"); //$NON-NLS-1$
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Sets the positions that should be highlighted as the target positions, i.e.
 * as the positions that can be jumped to in a linked set up.
 *
 * @param positions the new target positions, or <code>null</code> if no target positions are to be set
 * @throws BadLocationException in case any of the given positions is invalid
 */
private void setTargetPositions(List<Position> positions) throws BadLocationException {
  if (!fMarkTargets)
    return;
  // remove all positions which are already there
  // Algorithm: toRemove contains all mappings at first, but all that are in
  // positions get removed -> toRemove contains the difference set of previous - new
  // toAdd are the new positions, which don't exist in previous = new - previous
  List<Annotation> toRemove= new ArrayList<>(fTargetAnnotations.values());
  Map<Annotation, Position> toAdd= new HashMap<>();
  if (positions != null) {
    for (Position p : positions) {
      if (fTargetAnnotations.containsKey(p)) {
        toRemove.remove(fTargetAnnotations.get(p));
      } else {
        Annotation a= new Annotation(TARGET_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$
        toAdd.put(a, p);
        fTargetAnnotations.put(p, a);
      }
    }
  }
  fTargetAnnotations.values().removeAll(toRemove);
  replaceAnnotations(toRemove.toArray(new Annotation[0]), toAdd, false);
}
origin: org.eclipse.platform/org.eclipse.jface.text

private boolean includeAnnotation(Annotation annotation, Position position, HashMap<Position, Object> messagesAtPosition) {
  if (!isIncluded(annotation))
    return false;
  String text= annotation.getText();
  return (text != null && !isDuplicateAnnotation(messagesAtPosition, position, text));
}
org.eclipse.jface.text.sourceAnnotation

Javadoc

Annotation managed by an org.eclipse.jface.text.source.IAnnotationModel.

Annotations are typed, can have an associated text and can be marked as persistent and deleted. Annotations which are not explicitly initialized with an annotation type are of type "org.eclipse.text.annotation.unknown".

Most used methods

  • isMarkedDeleted
    Returns whether this annotation is marked as deleted.
  • getType
    Returns the type of the annotation.
  • <init>
    Creates a new annotation with the given persistence state.
  • getText
    Returns the text associated with this annotation.
  • isPersistent
    Returns whether this annotation is persistent.
  • markDeleted
    Marks this annotation deleted according to the value of thedeleted parameter.

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getSharedPreferences (Context)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • String (java.lang)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now