Examples of AnnotationPreference


Examples of org.eclipse.ui.texteditor.AnnotationPreference

     *         otherwise
     * @since 3.0
     */
    public boolean isNavigationTarget(final Annotation annotation) {
        final IPreferenceStore preferences = EditorsUI.getPreferenceStore();
        final AnnotationPreference preference = annotationPreferenceLookup
                .getAnnotationPreference(annotation);
        final String key = preference == null ? null : preference
                .getIsGoToNextNavigationTargetKey();
        return key != null && preferences.getBoolean(key);
    }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    MarkerAnnotationPreferences fMarkerAnnotationPreferences= EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
    SortedSet containers= new TreeSet();

    Iterator iter= fMarkerAnnotationPreferences.getAnnotationPreferences().iterator();
    while (iter.hasNext()) {
      AnnotationPreference preference= (AnnotationPreference)iter.next();
      String key= preference.getShowInNextPrevDropdownToolbarActionKey();
      if (key != null && fStore.getBoolean(key)) {
        String preferenceKey= getPreferenceKey(preference);

        /*
         * Fixes bug 41689
         * This code can be simplified if we decide that
         * we don't allow to use different settings for go to
         * previous and go to next annotation.
         */
        preferenceKey= preference.getIsGoToNextNavigationTargetKey();

        if (preferenceKey != null)
          containers.add(new NavigationEnablementAction(preference.getPreferenceLabel(), fStore, preferenceKey));
      }
    }

    return (IAction[]) containers.toArray(new Action[containers.size()]);
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    IPreferenceStore store= getPreferenceStore();
    if (store != null && fDelegate instanceof AnnotationRulerColumn) {
      final AnnotationRulerColumn column= (AnnotationRulerColumn) fDelegate;
      // initial set up
      for (Iterator iter2= fAnnotationPreferences.getAnnotationPreferences().iterator(); iter2.hasNext();) {
        AnnotationPreference preference= (AnnotationPreference)iter2.next();
        String key= preference.getVerticalRulerPreferenceKey();
        boolean showAnnotation= true;
        if (key != null && store.contains(key))
          showAnnotation= store.getBoolean(key);
        if (showAnnotation)
          column.addAnnotationType(preference.getAnnotationType());
      }
      column.addAnnotationType(Annotation.TYPE_UNKNOWN);
     
      // link to preference store
      fPropertyListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
          String property= event.getProperty();
          AnnotationPreference annotationPreference= getVerticalRulerAnnotationPreference(property);
          if (annotationPreference != null && event.getNewValue() instanceof Boolean) {
            Object type= annotationPreference.getAnnotationType();
            if (((Boolean)event.getNewValue()).booleanValue())
              column.addAnnotationType(type);
            else
              column.removeAnnotationType(type);
            column.redraw();
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    if (preferenceKey == null)
      return null;

    Iterator e= fAnnotationPreferences.getAnnotationPreferences().iterator();
    while (e.hasNext()) {
      AnnotationPreference info= (AnnotationPreference) e.next();
      if (info != null && preferenceKey.equals(info.getVerticalRulerPreferenceKey()))
        return info;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    fCache.add(attribute);
  }

  private AnnotationPreference getDefiningPreference(Object attribute) {

    AnnotationPreference p= fLookup.getAnnotationPreferenceFragment(fType.getType());
    if (p != null && p.hasValue(attribute))
      return p;

    String[] superTypes= fType.getSuperTypes();
    for (int i= 0; i < superTypes.length; i++) {
      p= fLookup.getAnnotationPreferenceFragment(superTypes[i]);
      if (p != null && p.hasValue(attribute))
        return p;
    }

    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    return null;
  }

  private Object getAttributeValue(Object attribute) {
    if (!isCached(attribute)) {
      AnnotationPreference preference= getDefiningPreference(attribute);
      if (preference != null)
        setValue(attribute, preference.getValue(attribute));
      markCached(attribute);
    }
    return getValue(attribute);
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

  /*
   * @see org.eclipse.ui.texteditor.AnnotationPreference#getAnnotationImageProvider()
   */
  public IAnnotationImageProvider getAnnotationImageProvider() {
    if (!isCached(IMAGE_PROVIDER)) {
      AnnotationPreference preference= getDefiningPreference(IMAGE_PROVIDER);
      if (preference != null) {
        fAnnotationImageProvider= preference.fAnnotationImageProvider;
        fAnnotationImageProviderAttribute= preference.fAnnotationImageProviderAttribute;
        fConfigurationElement= preference.fConfigurationElement;
      }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

    updateRevisionRenderingMode(store, fDelegate);
    updateRevisionAuthorVisibility(store, fDelegate);
    updateRevisionIdVisibility(store, fDelegate);

    Map annotationPrefs= getAnnotationPreferenceMap();
    final AnnotationPreference changedPref= (AnnotationPreference) annotationPrefs.get("org.eclipse.ui.workbench.texteditor.quickdiffChange"); //$NON-NLS-1$
    final AnnotationPreference addedPref= (AnnotationPreference) annotationPrefs.get("org.eclipse.ui.workbench.texteditor.quickdiffAddition"); //$NON-NLS-1$
    final AnnotationPreference deletedPref= (AnnotationPreference) annotationPrefs.get("org.eclipse.ui.workbench.texteditor.quickdiffDeletion"); //$NON-NLS-1$
    updateChangedColor(changedPref, store, fDelegate);
    updateAddedColor(addedPref, store, fDelegate);
    updateDeletedColor(deletedPref, store, fDelegate);

    fDelegate.redraw();

    // listen to changes
    fDispatcher= new PropertyEventDispatcher(store);

    fDispatcher.addPropertyChangeListener(FG_COLOR_KEY, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateForegroundColor(store, fDelegate);
        fDelegate.redraw();
      }
    });
    IPropertyChangeListener backgroundHandler= new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateBackgroundColor(store, fDelegate);
        fDelegate.redraw();
      }
    };
    fDispatcher.addPropertyChangeListener(BG_COLOR_KEY, backgroundHandler);
    fDispatcher.addPropertyChangeListener(USE_DEFAULT_BG_KEY, backgroundHandler);

    fDispatcher.addPropertyChangeListener(LINE_NUMBER_KEY, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        // only handle quick diff on/off information, but not ruler visibility (handled by AbstractDecoratedTextEditor)
        updateLineNumbersVisibility(fDelegate);
      }
    });

    fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateCharacterMode(store, fDelegate);
      }
    });

    fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_RENDERING_MODE, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateRevisionRenderingMode(store, fDelegate);
      }
    });
   
    fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_AUTHOR, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateRevisionAuthorVisibility(store, fDelegate);
      }
    });
   
    fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_REVISION, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateRevisionIdVisibility(store, fDelegate);
      }
    });
   
    fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON, new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        updateQuickDiffVisibility(fDelegate);
      }
    });

    if (changedPref != null) {
      fDispatcher.addPropertyChangeListener(changedPref.getColorPreferenceKey(), new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
          updateChangedColor(changedPref, store, fDelegate);
          fDelegate.redraw();
        }
      });
    }
    if (addedPref != null) {
      fDispatcher.addPropertyChangeListener(addedPref.getColorPreferenceKey(), new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
          updateAddedColor(addedPref, store, fDelegate);
          fDelegate.redraw();
        }
      });
    }
    if (deletedPref != null) {
      fDispatcher.addPropertyChangeListener(deletedPref.getColorPreferenceKey(), new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
          updateDeletedColor(deletedPref, store, fDelegate);
          fDelegate.redraw();
        }
      });
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

  private Map getAnnotationPreferenceMap() {
    Map annotationPrefs= new HashMap();
    Iterator iter= fAnnotationPreferences.getAnnotationPreferences().iterator();
    while (iter.hasNext()) {
      AnnotationPreference pref= (AnnotationPreference) iter.next();
      Object type= pref.getAnnotationType();
      annotationPrefs.put(type, pref);
    }
    return annotationPrefs;
  }
View Full Code Here

Examples of org.eclipse.ui.texteditor.AnnotationPreference

  /*
   * @see DefaultAnnotationHover#isIncluded(Annotation)
   * @since 3.2
   */
  protected boolean isShowInVerticalRuler(Annotation annotation) {
    AnnotationPreference preference= getAnnotationPreference(annotation);
    if (preference == null)
      return true;
    String key= preference.getVerticalRulerPreferenceKey();
    // backward compatibility
    if (key != null && !fPreferenceStore.getBoolean(key))
      return false;
   
    return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.