}
private RtePlugin buildStylesRtePlugin(RichTextEditor rteAnnotation) {
if (rteAnnotation.styles().length > 0) {
Styles stylesAnnotation = rteAnnotation.styles()[0];
List<DialogElement> styleList = new ArrayList<DialogElement>();
for (int i = 0; i < stylesAnnotation.styles().length; i++) {
String styleFieldName = "style" + i;
RteStyleParameters styleParameters = new RteStyleParameters();
styleParameters.setFieldName(styleFieldName);
styleParameters.setCssName(stylesAnnotation.styles()[i].cssName());
styleParameters.setText(stylesAnnotation.styles()[i].text());
styleList.add(new RteStyle(styleParameters));
}
RtePluginParameters widgetParameters = new RtePluginParameters();
widgetParameters.setFieldName("spellcheck");
widgetParameters.setFeatures(ALL_FEATURES);