예제 #1
0
  /**
   * Common TextColorer creation constructor. Creates TextColorer object, which is to be attached to
   * the StyledText widget.
   *
   * @param pf Parser factory, used to create all coloring text parsers.
   * @param cm Color Manager, used to store cached color objects
   */
  public TextColorer(ParserFactory pf, ColorManager cm) {
    this.pf = pf;
    this.cm = cm;

    setFullBackground(false);
    setCross(false, false);

    baseEditor =
        new BaseEditorNative(
            pf,
            new LineSource() {
              public String getLine(int lno) {
                if (text.getContent().getLineCount() <= lno) return null;
                String line = text.getContent().getLine(lno);
                return line;
              }
            });
    baseEditor.setRegionCompact(true);
  }