import org.eclipse.jface.text.rules.RuleBasedScanner;\r
import org.eclipse.jface.text.rules.SingleLineRule;\r
import org.eclipse.jface.text.rules.Token;\r
+import org.eclipse.swt.SWT;\r
import org.eclipse.swt.graphics.Color;\r
import org.eclipse.swt.graphics.RGB;\r
import org.eclipse.swt.widgets.Display;\r
\r
+import com.swtdesigner.SWTResourceManager;\r
+\r
public class MyRuleScanner extends RuleBasedScanner {\r
private static Color TAG_COLOR= new Color(Display.getCurrent(), new RGB(200, 0, 0));\r
private static Color COMMENT_COLOR= new Color(Display.getCurrent(), new RGB(0, 200, 0));\r
\r
public MyRuleScanner() {\r
IToken tagToken =\r
- new Token(\r
- new TextAttribute(TAG_COLOR));\r
+ new Token(new TextAttribute(TAG_COLOR));\r
+// new TextAttribute(TAG_COLOR,\r
+// null,\r
+// SWT.BOLD,\r
+// SWTResourceManager.getFont("Georgia", 11, SWT.NONE)));\r
\r
IToken commentToken= new Token(new TextAttribute(COMMENT_COLOR));\r
\r
IRule[] rules = new IRule[2];\r
//Add rule for processing instructions\r
rules[0] = new SingleLineRule("<myTag", "myTag>", tagToken);\r
- rules[1] = (new EndOfLineRule("//", commentToken)); //$NON-NLS-1$\r
+ rules[1] = new EndOfLineRule("//", commentToken); //$NON-NLS-1$\r
setRules(rules);\r
}\r
}\r