private ITokenScanner getRecipeScanner() {
RuleBasedScanner scanner = new RuleBasedScanner();
- IRule[] rules = new IRule[11];
+ IRule[] rules = new IRule[14];
rules[0] = createHeader6Rule();
rules[1] = createHeader5Rule();
rules[2] = createHeader4Rule();
rules[8] = createExternalHTTPRule();
rules[9] = createListRule();
rules[10] = createNumberedListRule();
+ rules[11] = createBoldItalicRule();
+ rules[12] = createBoldRule();
+ rules[13] = createItalicRule();
scanner.setRules(rules);
return scanner;
// return wordRule;
// }
+ private IRule createBoldRule() {
+ IToken boldToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 0)), null, SWT.BOLD));
+ SingleLineRule singleLineRule = new SingleLineRule("'''", "'''", boldToken);
+ return singleLineRule;
+ }
+
+ private IRule createItalicRule() {
+ IToken italicToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 0)), null, SWT.ITALIC));
+ SingleLineRule singleLineRule = new SingleLineRule("''", "''", italicToken);
+ return singleLineRule;
+ }
+
+ private IRule createBoldItalicRule() {
+ IToken boldToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 0)), null, SWT.BOLD | SWT.ITALIC));
+ SingleLineRule singleLineRule = new SingleLineRule("'''''", "'''''", boldToken);
+ return singleLineRule;
+ }
+
private IRule createHRRule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("----", "\n", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader1Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("=", "=", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader2Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("==", "==", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader3Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("===", "===", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader4Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("====", "====", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader5Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("=====", "=====", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
}
private IRule createHeader6Rule() {
- IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.ITALIC));
+ IToken quantityToken = new Token(new TextAttribute(fColors.getColor(new RGB(0, 0, 140)), null, SWT.NONE));
SingleLineRule singleLineRule = new SingleLineRule("======", "======", quantityToken);
singleLineRule.setColumnConstraint(0);
return singleLineRule;
// }
private IRule createListRule() {
- IToken dashToken = new Token(new TextAttribute(fColors.getColor(new RGB(63, 127, 95)), null, SWT.BOLD));
+ IToken dashToken = new Token(new TextAttribute(fColors.getColor(new RGB(63, 127, 95)), null, SWT.NONE));
// WordRule wordRule= new WordRule(new SimpleListDetector());
// wordRule.addWord("*", dashToken);
SingleLineRule singleLineRule = new SingleLineRule("*", "\n", dashToken);
}
private IRule createNumberedListRule() {
- IToken dashToken = new Token(new TextAttribute(fColors.getColor(new RGB(63, 127, 95)), null, SWT.BOLD));
+ IToken dashToken = new Token(new TextAttribute(fColors.getColor(new RGB(63, 127, 95)), null, SWT.NONE));
// WordRule wordRule= new WordRule(new SimpleListDetector());
// wordRule.addWord("#", dashToken);
SingleLineRule singleLineRule = new SingleLineRule("#", "\n", dashToken);
}
private IRule createLinkRule() {
- IToken stepToken = new Token(new TextAttribute(fColors.getColor(new RGB(200, 100, 100)), null, SWT.BOLD));
+ IToken stepToken = new Token(new TextAttribute(fColors.getColor(new RGB(200, 100, 100)), null, SWT.NONE));
SingleLineRule stepRule = new SingleLineRule("[[", "]]", stepToken);
// stepRule.setColumnConstraint(0);
return stepRule;
}
private IRule createExternalHTTPRule() {
- IToken stepToken = new Token(new TextAttribute(fColors.getColor(new RGB(200, 100, 100)), null, SWT.BOLD));
+ IToken stepToken = new Token(new TextAttribute(fColors.getColor(new RGB(200, 100, 100)), null, SWT.NONE));
SingleLineRule stepRule = new SingleLineRule("[http", "]", stepToken);
// stepRule.setColumnConstraint(0);
return stepRule;
}
-
+
/*
* @see SourceViewerConfiguration#getReconciler(ISourceViewer)
*/