01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.editors.xml;
05:
06: import org.eclipse.jface.text.rules.IPredicateRule;
07: import org.eclipse.jface.text.rules.IToken;
08: import org.eclipse.jface.text.rules.MultiLineRule;
09: import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
10: import org.eclipse.jface.text.rules.Token;
11:
12: public class XMLPartitionScanner extends RuleBasedPartitionScanner {
13: public final static String XML_DEFAULT = "__xml_default";
14: public final static String XML_COMMENT = "__xml_comment";
15: public final static String XML_TAG = "__xml_tag";
16:
17: public XMLPartitionScanner() {
18:
19: IToken xmlComment = new Token(XML_COMMENT);
20: IToken tag = new Token(XML_TAG);
21:
22: IPredicateRule[] rules = new IPredicateRule[2];
23:
24: rules[0] = new MultiLineRule("<!--", "-->", xmlComment);
25: rules[1] = new TagRule(tag);
26:
27: setPredicateRules(rules);
28: }
29: }
|