01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.templateeditor.editors;
11:
12: import org.eclipse.jface.text.rules.*;
13:
14: public class XMLPartitionScanner extends RuleBasedPartitionScanner {
15: public final static String XML_DEFAULT = "__xml_default"; //$NON-NLS-1$
16: public final static String XML_COMMENT = "__xml_comment"; //$NON-NLS-1$
17: public final static String XML_TAG = "__xml_tag"; //$NON-NLS-1$
18:
19: public XMLPartitionScanner() {
20:
21: IToken xmlComment = new Token(XML_COMMENT);
22: IToken tag = new Token(XML_TAG);
23:
24: IPredicateRule[] rules = new IPredicateRule[2];
25:
26: rules[0] = new MultiLineRule("<!--", "-->", xmlComment); //$NON-NLS-1$//$NON-NLS-2$
27: rules[1] = new TagRule(tag);
28:
29: setPredicateRules(rules);
30: }
31: }
|