Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.AnnotationPreference


   * @return the annotation preference
   */
  private AnnotationPreference getAnnotationPreferenceInfo(String preferenceKey) {
    Iterator e= fAnnotationTypeKeyMap.values().iterator();
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      if (info != null && info.isPreferenceKey(preferenceKey))
        return info;
    }
    return null;
  }
View Full Code Here


        fMarginPainter.paint(IPainter.CONFIGURATION);
      }
      return;
    }
   
    AnnotationPreference info= getAnnotationPreferenceInfo(p);
    if (info != null) {
     
      if (info.getColorPreferenceKey().equals(p)) {
        Color color= getColor(info.getColorPreferenceKey());
        if (fAnnotationPainter != null) {
          fAnnotationPainter.setAnnotationTypeColor(info.getAnnotationType(), color);
          fAnnotationPainter.paint(IPainter.CONFIGURATION);
        }
        setAnnotationOverviewColor(info.getAnnotationType(), color);
        return;
      }
     
      if (info.getTextPreferenceKey().equals(p) || info.getTextStylePreferenceKey() != null && info.getTextStylePreferenceKey().equals(p)) {
        Object style= getAnnotationDecorationType(info.getAnnotationType());
        if (AnnotationPreference.STYLE_NONE != style)
          showAnnotations(info.getAnnotationType(), false, true);
        else
          hideAnnotations(info.getAnnotationType(), false, true);
        return;
      }
     
      if (info.getHighlightPreferenceKey() != null && info.getHighlightPreferenceKey().equals(p)) {
        if (areAnnotationsHighlighted(info.getAnnotationType()))
          showAnnotations(info.getAnnotationType(), true, true);
        else
          hideAnnotations(info.getAnnotationType(), true, true);
        return;
      }
     
      Object style= getAnnotationDecorationType(info.getAnnotationType());
      if (style != AnnotationPreference.STYLE_NONE)
        showAnnotations(info.getAnnotationType(), false, false);
      else
//        hideAnnotations(info.getAnnotationType(), false, false);

      if (info.getOverviewRulerPreferenceKey().equals(p)) {
        if (isAnnotationOverviewShown(info.getAnnotationType()))
          showAnnotationOverview(info.getAnnotationType(), true);
        else
          hideAnnotationOverview(info.getAnnotationType(), true);
        return;
      }
    }     
       
  }
View Full Code Here

   *
   * @param annotationType the annotation type
   * @return the color of the annotation type
   */
  private Color getAnnotationTypeColor(Object annotationType) {
    AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType);
    if (info != null)
      return getColor( info.getColorPreferenceKey());
    return null;
  }
View Full Code Here

   *
   * @param annotationType the annotation type
   * @return the layer
   */
  private int getAnnotationTypeLayer(Object annotationType) {
    AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType);
    if (info != null)
      return info.getPresentationLayer();
    return 0;
  }
View Full Code Here

   * @return <code>true</code> if the annotations are shown
   */ 
  private boolean areAnnotationsShown(Object annotationType) {
    if (fPreferenceStore != null) {
     
      AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType);
      if (info != null) {
        String key= info.getTextPreferenceKey();
       
        return key != null && fPreferenceStore.getBoolean(key);
      }
    }
    return false;
View Full Code Here

   * @return <code>true</code> if the annotations are highlighted
   * @since 3.0
   */ 
  private boolean areAnnotationsHighlighted(Object annotationType) {
    if (fPreferenceStore != null) {
      AnnotationPreference info= (AnnotationPreference)fAnnotationTypeKeyMap.get(annotationType);
      if (info != null)
        return info.getHighlightPreferenceKey() != null && fPreferenceStore.getBoolean(info.getHighlightPreferenceKey());
    }
    return false;
  }
View Full Code Here

   * @param annotationType the annotation type
   * @return <code>true</code> if the annotation overview is shown
   */ 
  private boolean isAnnotationOverviewShown(Object annotationType) {
    if (fPreferenceStore != null && fOverviewRuler != null) {
      AnnotationPreference info= (AnnotationPreference) fAnnotationTypeKeyMap.get(annotationType);
      if (info != null)
        return fPreferenceStore.getBoolean(info.getOverviewRulerPreferenceKey());
    }
    return false;
  }
View Full Code Here

TOP

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

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.