Beispiel #1
0
  /**
   * Creates the highlighting manager class.
   *
   * @param textResource the text resource to be provided to other classes
   * @param sourceviewer the source viewer converts offset between master and slave documents
   * @param colorManager the color manager provides highlighting colors
   * @param editor
   */
  public BentoHighlighting(
      bento.language.bentocomp.resource.bento.IBentoTextResource textResource,
      org.eclipse.jface.text.source.projection.ProjectionViewer sourceviewer,
      bento.language.bentocomp.resource.bento.ui.BentoColorManager colorManager,
      bento.language.bentocomp.resource.bento.ui.BentoEditor editor) {
    this.display = org.eclipse.swt.widgets.Display.getCurrent();
    sourceviewer.getSelectionProvider();
    preferenceStore =
        bento.language.bentocomp.resource.bento.ui.BentoUIPlugin.getDefault().getPreferenceStore();
    this.editor = editor;
    textWidget = sourceviewer.getTextWidget();
    projectionViewer = sourceviewer;
    scanner =
        new bento.language.bentocomp.resource.bento.ui.BentoTokenScanner(
            textResource, colorManager);
    occurrence =
        new bento.language.bentocomp.resource.bento.ui.BentoOccurrence(
            textResource, sourceviewer, scanner);
    bracketSet =
        new bento.language.bentocomp.resource.bento.ui.BentoBracketSet(editor, sourceviewer);
    this.colorManager = colorManager;
    isHighlightBrackets =
        preferenceStore.getBoolean(
            bento.language.bentocomp.resource.bento.ui.BentoPreferenceConstants
                .EDITOR_MATCHING_BRACKETS_CHECKBOX);
    bracketColor =
        colorManager.getColor(
            org.eclipse.jface.preference.PreferenceConverter.getColor(
                preferenceStore,
                bento.language.bentocomp.resource.bento.ui.BentoPreferenceConstants
                    .EDITOR_MATCHING_BRACKETS_COLOR));
    black = colorManager.getColor(new org.eclipse.swt.graphics.RGB(0, 0, 0));

    addListeners(editor);
  }
Beispiel #2
0
 public void init(org.eclipse.ui.IWorkbench workbench) {
   setPreferenceStore(
       bento.language.bentocomp.resource.bento.ui.BentoUIPlugin.getDefault().getPreferenceStore());
   setDescription("Bento Text Editor Preferences");
 }