Package tk.eclipse.plugin.dtdeditor.editors

Source Code of tk.eclipse.plugin.dtdeditor.editors.DTDTagScanner

package tk.eclipse.plugin.dtdeditor.editors;

import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.MultiLineRule;
import org.eclipse.jface.text.rules.WhitespaceRule;

import tk.eclipse.plugin.htmleditor.ColorProvider;
import tk.eclipse.plugin.htmleditor.HTMLPlugin;
import tk.eclipse.plugin.htmleditor.editors.HTMLTagScanner;
import tk.eclipse.plugin.htmleditor.editors.HTMLWhitespaceDetector;

/**
* @author Naoki Takezoe
*/
public class DTDTagScanner extends HTMLTagScanner {

  public DTDTagScanner(ColorProvider colorProvider) {
    super(colorProvider);
   
    IToken string = colorProvider.getToken(HTMLPlugin.PREF_COLOR_STRING);
   
    IRule[] rules = new IRule[3];
    rules[0] = new MultiLineRule("\"" , "\"" , string, '\\');
    rules[1] = new MultiLineRule("(" , ")" , string);
    rules[2] = new WhitespaceRule(new HTMLWhitespaceDetector());
   
    setRules(rules);
  }
 
}
TOP

Related Classes of tk.eclipse.plugin.dtdeditor.editors.DTDTagScanner

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.