|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 package com.symbian.smt.gui.editors.xmleditor; |
|
19 |
|
20 import org.eclipse.jface.text.rules.IPredicateRule; |
|
21 import org.eclipse.jface.text.rules.IToken; |
|
22 import org.eclipse.jface.text.rules.MultiLineRule; |
|
23 import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; |
|
24 import org.eclipse.jface.text.rules.Token; |
|
25 |
|
26 /** |
|
27 * @author barbararosi-schwartz |
|
28 * |
|
29 */ |
|
30 public class XMLPartitionScanner extends RuleBasedPartitionScanner { |
|
31 public final static String XML_COMMENT = "__xml_comment"; |
|
32 public final static String XML_TAG = "__xml_tag"; |
|
33 |
|
34 public XMLPartitionScanner() { |
|
35 |
|
36 IToken xmlComment = new Token(XML_COMMENT); |
|
37 IToken tag = new Token(XML_TAG); |
|
38 |
|
39 IPredicateRule[] rules = new IPredicateRule[2]; |
|
40 |
|
41 rules[0] = new MultiLineRule("<!--", "-->", xmlComment); |
|
42 rules[1] = new TagRule(tag); |
|
43 |
|
44 setPredicateRules(rules); |
|
45 } |
|
46 } |