コード例 #1
0
  /**
   * Handle the given property change event
   *
   * @param event The event
   */
  private void handlePropertyChangeEvent(PropertyChangeEvent event) {
    if (fPreferenceStore == null) return; // Uninstalled during event notification

    if (fConfiguration != null) fConfiguration.handlePropertyChangeEvent(event);

    if (SemanticHighlightings.affectsEnablement(fPreferenceStore, event)) {
      if (isEnabled()) enable();
      else disable();
    }

    if (!isEnabled()) return;

    boolean refreshNeeded = false;

    /*
     * for (int i= 0, n= fSemanticHighlightings.length; i < n; i++) {
     * SemanticHighlighting semanticHighlighting= fSemanticHighlightings[i];
     *
     * String colorKey=
     * SemanticHighlightings.getColorPreferenceKey(semanticHighlighting); if
     * (colorKey.equals(event.getProperty())) {
     * adaptToTextForegroundChange(fHighlightings[i], event);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; }
     *
     * String boldKey=
     * SemanticHighlightings.getBoldPreferenceKey(semanticHighlighting); if
     * (boldKey.equals(event.getProperty())) {
     * adaptToTextStyleChange(fHighlightings[i], event, SWT.BOLD);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; }
     *
     * String italicKey=
     * SemanticHighlightings.getItalicPreferenceKey(semanticHighlighting);
     * if (italicKey.equals(event.getProperty())) {
     * adaptToTextStyleChange(fHighlightings[i], event, SWT.ITALIC);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; }
     *
     * String strikethroughKey=
     * SemanticHighlightings.getStrikethroughPreferenceKey
     * (semanticHighlighting); if
     * (strikethroughKey.equals(event.getProperty())) {
     * adaptToTextStyleChange(fHighlightings[i], event,
     * TextAttribute.STRIKETHROUGH);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; }
     *
     * String underlineKey=
     * SemanticHighlightings.getUnderlinePreferenceKey(semanticHighlighting
     * ); if (underlineKey.equals(event.getProperty())) {
     * adaptToTextStyleChange(fHighlightings[i], event,
     * TextAttribute.UNDERLINE);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; }
     *
     * String enabledKey=
     * SemanticHighlightings.getEnabledPreferenceKey(semanticHighlighting);
     * if (enabledKey.equals(event.getProperty())) {
     * adaptToEnablementChange(fHighlightings[i], event);
     * fPresenter.highlightingStyleChanged(fHighlightings[i]);
     * refreshNeeded= true; continue; } }
     */

    if (refreshNeeded && fReconciler != null) fReconciler.refresh();
  }