⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commentscanner.java

📁 <Apress.The.Definitive.Guide.to.SWT.and.JFace.eBook-LiB>书籍配套源代码
💻 JAVA
字号:
package examples.ch18.perledit.source;

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.*;

import examples.ch18.perledit.PerlEditor;

/**
 * This class scans comment partitions
 */
public class CommentScanner extends RuleBasedScanner {
  /**
   * CommentScanner constructor
   */
  public CommentScanner() {
    // Get the color manager
    ColorManager colorManager = PerlEditor.getApp().getColorManager();

    // Create the tokens
    IToken other = new Token(new TextAttribute(colorManager
        .getColor(ColorManager.COMMENT)));

    // Use "other" for default
    setDefaultReturnToken(other);

    // This scanner has an easy job--we need no rules. Anything in a comment
    // partition should be scanned as a comment
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -