diff -r 000000000000 -r 522a326673b6 sysmodelmgr/com.symbian.smt.gui/src/com/symbian/smt/gui/editors/xmleditor/XMLPartitionScanner.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysmodelmgr/com.symbian.smt.gui/src/com/symbian/smt/gui/editors/xmleditor/XMLPartitionScanner.java Thu Mar 11 19:08:43 2010 +0200 @@ -0,0 +1,46 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +package com.symbian.smt.gui.editors.xmleditor; + +import org.eclipse.jface.text.rules.IPredicateRule; +import org.eclipse.jface.text.rules.IToken; +import org.eclipse.jface.text.rules.MultiLineRule; +import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; +import org.eclipse.jface.text.rules.Token; + +/** + * @author barbararosi-schwartz + * + */ +public class XMLPartitionScanner extends RuleBasedPartitionScanner { + public final static String XML_COMMENT = "__xml_comment"; + public final static String XML_TAG = "__xml_tag"; + + public XMLPartitionScanner() { + + IToken xmlComment = new Token(XML_COMMENT); + IToken tag = new Token(XML_TAG); + + IPredicateRule[] rules = new IPredicateRule[2]; + + rules[0] = new MultiLineRule("", xmlComment); + rules[1] = new TagRule(tag); + + setPredicateRules(rules); + } +}