1 | package de.uka.ipd.sdq.pcm.gmf.resource.editors; |
2 | |
3 | import org.eclipse.jface.text.rules.IPredicateRule; |
4 | import org.eclipse.jface.text.rules.IToken; |
5 | import org.eclipse.jface.text.rules.MultiLineRule; |
6 | import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; |
7 | import org.eclipse.jface.text.rules.Token; |
8 | |
9 | public class XMLPartitionScanner extends RuleBasedPartitionScanner { |
10 | public final static String XML_COMMENT = "__xml_comment"; |
11 | public final static String XML_TAG = "__xml_tag"; |
12 | |
13 | public XMLPartitionScanner() { |
14 | |
15 | IToken xmlComment = new Token(XML_COMMENT); |
16 | IToken tag = new Token(XML_TAG); |
17 | |
18 | IPredicateRule[] rules = new IPredicateRule[2]; |
19 | |
20 | rules[0] = new MultiLineRule("<!--", "-->", xmlComment); |
21 | rules[1] = new TagRule(tag); |
22 | |
23 | setPredicateRules(rules); |
24 | } |
25 | } |