コード例 #1
0
  /** Enable code coloring */
  private void enable() {
    // initializeCodeColors();

    fPresenter = new ColoredHighlightingPresenter();
    fPresenter.install(fSourceViewer, fPresentationReconciler);

    if (fEditor != null) {
      fReconciler = new ColoredHighlightingReconciler();
      fReconciler.setColorManager(compUnitColorManager);
      fReconciler.install(fEditor, fSourceViewer, fPresenter);
    } else {
      fPresenter.updatePresentation(null, new CodeSegment[0], new CodeSegment[0]);
    }
  }
コード例 #2
0
  /** Disable semantic highlighting. */
  private void disable() {
    if (fReconciler != null) {
      fReconciler.uninstall();
      fReconciler = null;
    }

    if (fPresenter != null) {
      fPresenter.uninstall();
      fPresenter = null;
    }
  }