~piastucki/bzr-eclipse/history-view-enhancements

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.ui/src/org/vcs/bazaar/eclipse/ui/editors/XMLScanner.java

  • Committer: Guillermo Gonzalez
  • Date: 2007-03-14 12:15:50 UTC
  • Revision ID: guillo.gonzo@gmail.com-20070314121550-tltk3b6f3zblf0dh
Initial commit with the new code layout.
Now starts the real work

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.vcs.bazaar.eclipse.ui.editors;
 
2
 
 
3
import org.eclipse.jface.text.rules.*;
 
4
import org.eclipse.jface.text.*;
 
5
 
 
6
public class XMLScanner extends RuleBasedScanner {
 
7
 
 
8
        public XMLScanner(ColorManager manager) {
 
9
                IToken procInstr =
 
10
                        new Token(
 
11
                                new TextAttribute(
 
12
                                        manager.getColor(IXMLColorConstants.PROC_INSTR)));
 
13
 
 
14
                IRule[] rules = new IRule[2];
 
15
                //Add rule for processing instructions
 
16
                rules[0] = new SingleLineRule("<?", "?>", procInstr);
 
17
                // Add generic whitespace rule.
 
18
                rules[1] = new WhitespaceRule(new XMLWhitespaceDetector());
 
19
 
 
20
                setRules(rules);
 
21
        }
 
22
}