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

📄 perlpartitionscanner.java

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

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

/**
 * This class scans a document and partitions it
 */
public class PerlPartitionScanner extends RuleBasedPartitionScanner {
  // Create a partition for comments, and leave the rest for code
  public static final String COMMENT = "comment";
  public static final String[] TYPES = { COMMENT};

  /**
   * PerlPartitionScanner constructor
   */
  public PerlPartitionScanner() {
    super();

    // Create the token for comment partitions
    IToken comment = new Token(COMMENT);

    // Set the rule--anything from # to the end of the line is a comment
    setPredicateRules(new IPredicateRule[] { new EndOfLineRule("#", comment)});
  }
}

⌨️ 快捷键说明

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