Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.AnnotationPreference


  /*
   * @see DefaultAnnotationHover#isIncluded(Annotation)
   * @since 3.2
   */
  protected boolean isShowInOverviewRuler(Annotation annotation) {
    AnnotationPreference preference= getAnnotationPreference(annotation);
    if (preference == null)
      return true;
    String key= preference.getOverviewRulerPreferenceKey();
    if (key == null || !fPreferenceStore.getBoolean(key))
      return false;
   
    return true;
  }
View Full Code Here


  /*
   * @see DefaultTextHover#isIncluded(Annotation)
   * @since 3.2
   */
  protected boolean isShownInText(Annotation annotation) {
    AnnotationPreference preference= getAnnotationPreference(annotation);
    if (preference == null)
      return false;
    String key= preference.getTextPreferenceKey();
    if (key != null) {
      if (!fPreferenceStore.getBoolean(key))
        return false;
    } else {
      key= preference.getHighlightPreferenceKey();
      if (key == null || !fPreferenceStore.getBoolean(key))
        return false;
    }
    return true;
  }
View Full Code Here

    ArrayList overlayKeys= new ArrayList();
    Iterator e= preferences.getAnnotationPreferences().iterator();

    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
      overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
      if (info.getHighlightPreferenceKey() != null)
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
      overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
      if (info.getVerticalRulerPreferenceKey() != null)
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getVerticalRulerPreferenceKey()));
      if (info.getTextStylePreferenceKey() != null)
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getTextStylePreferenceKey()));
    }
    OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
    overlayKeys.toArray(keys);
    return keys;
  }
View Full Code Here

  private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
    ArrayList listModelItems= new ArrayList();
    Iterator e= preferences.getAnnotationPreferences().iterator();

    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      if (info.isIncludeOnPreferencePage()) {
        String label= info.getPreferenceLabel();
        if (containsMoreThanOne(preferences.getAnnotationPreferences().iterator(), label))
          label += " (" + info.getAnnotationType() + ")"//$NON-NLS-1$//$NON-NLS-2$

        Image image= getImage(info);

        listModelItems.add(new ListItem(label, image, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey()));
      }
    }

    Comparator comparator= new Comparator() {
      /*
 
View Full Code Here

  private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) {
    ArrayList overlayKeys= new ArrayList();

    Iterator e= preferences.getAnnotationPreferences().iterator();
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
     
      if (isLinkedModeAnnotation(info)) {
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getTextStylePreferenceKey()));
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
      }
    }
   
    OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
    overlayKeys.toArray(keys);
View Full Code Here

  private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
    ArrayList listModelItems= new ArrayList();
    Iterator e= preferences.getAnnotationPreferences().iterator();
   
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      if (isLinkedModeAnnotation(info)) {
        String label= info.getPreferenceLabel();
        List styles= getStyles(info.getAnnotationType());
        listModelItems.add(new ListItem(label, null, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey(), styles));
      }
    }
   
    ListItem[] items= new ListItem[listModelItems.size()];
    listModelItems.toArray(items);
View Full Code Here

    overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON));
    overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER));

    Iterator e= preferences.getAnnotationPreferences().iterator();
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();

      if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$
        || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
        || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
      ) {
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
        overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
      }
    }

    OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
    overlayKeys.toArray(keys);
View Full Code Here

  private String[][] createQuickDiffModel(MarkerAnnotationPreferences preferences) {
    String[][] items= new String[3][];

    Iterator e= preferences.getAnnotationPreferences().iterator();
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange")) //$NON-NLS-1$
        items[0]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_changeColor };
      else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
        items[1]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_additionColor };
      else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
        items[2]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.QuickDiffConfigurationBlock_deletionColor };
    }
    return items;
  }
View Full Code Here

        fAnnotation = annotation;
        fHasCorrection = true;
        layer = annotationLayer;
        continue;
      } else {
        AnnotationPreference preference = fAnnotationPreferenceLookup
                .getAnnotationPreference(annotation);
        if (preference == null)
          continue;

        String key = preference.getVerticalRulerPreferenceKey();
        if (key == null)
          continue;

        if (fStore.getBoolean(key)) {
          fPosition = position;
View Full Code Here

        String annotationType = SelectionAnnotation.TYPE + "."
            + String.valueOf(colorID + 1);

        AnnotationPreferenceLookup lookup = EditorsUI
            .getAnnotationPreferenceLookup();
        AnnotationPreference ap = lookup
            .getAnnotationPreference(annotationType);
        if (ap == null) {
            return null;
        }

        RGB rgb;
        try {
            rgb = PreferenceConverter.getColor(EditorsUI.getPreferenceStore(),
                ap.getColorPreferenceKey());
        } catch (RuntimeException e) {
            return null;
        }

        return new Color(Display.getDefault(), rgb);
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.