1 11 package org.eclipse.pde.internal.ui.editor.text; 12 13 import java.util.ArrayList ; 14 15 import org.eclipse.jface.text.rules.IPredicateRule; 16 import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; 17 import org.eclipse.jface.text.rules.SingleLineRule; 18 import org.eclipse.jface.text.rules.Token; 19 20 public class ManifestPartitionScanner extends RuleBasedPartitionScanner { 21 22 public static final String MANIFEST_HEADER_VALUE = "__mf_bundle_header_value"; 24 public static final String MANIFEST_FILE_PARTITIONING= "___mf_partitioning"; 26 public static final String [] PARTITIONS = new String [] {MANIFEST_HEADER_VALUE}; 27 28 public ManifestPartitionScanner() { 29 30 Token value = new Token(MANIFEST_HEADER_VALUE); 31 ArrayList rules = new ArrayList (); 32 rules.add(new SingleLineRule("=", null, value, '\\', true, true)); rules.add(new SingleLineRule(":", null, value, '\\', true, true)); rules.add(new SingleLineRule(" ", null, value, '\\', true, true)); rules.add(new SingleLineRule("\t", null, value, '\\', true, true)); setPredicateRules((IPredicateRule[])rules.toArray(new IPredicateRule[rules.size()])); 37 } 38 39 } 40 | Popular Tags |