use of org.metaborg.core.style.Style in project spoofax by metaborg.
the class StylerFacetFromESV method style.
private static IStyle style(IStrategoAppl attribute) {
final Color color = color((IStrategoAppl) attribute.getSubterm(0));
final Color backgroundColor = color((IStrategoAppl) attribute.getSubterm(1));
final boolean bold;
final boolean italic;
final boolean underline = false;
final boolean strikeout = false;
final IStrategoAppl fontSetting = (IStrategoAppl) attribute.getSubterm(2);
final String fontSettingCons = fontSetting.getConstructor().getName();
switch(fontSettingCons) {
case "BOLD":
bold = true;
italic = false;
break;
case "ITALIC":
bold = false;
italic = true;
break;
case "BOLD_ITALIC":
bold = true;
italic = true;
break;
default:
bold = false;
italic = false;
break;
}
return new Style(color, backgroundColor, bold, italic, underline, strikeout);
}
Aggregations