- Object eventSource = e.getSource();
- if (eventSource instanceof StyleButton) {
- StyleButton sb = (StyleButton) e.getSource();
- String style = sb.getData(RWT.CUSTOM_VARIANT).toString();
- textViewer.setParagraphStyle((Paragraph) currentTextPart, style);
- } else if (eventSource == deleteButton) {
- textViewer.deletePart((SectionPart) currentTextPart);
- } else if (eventSource == editButton) {
- textViewer.getCmsEditable().startEditing();
- } else if (eventSource == publishButton) {
- textViewer.getCmsEditable().stopEditing();
- }
+// Object eventSource = e.getSource();
+//// if (eventSource instanceof StyleButton) {
+ // TODO make it more robust.
+ Label sb = (Label) e.getSource();
+ Object style = sb.getData(RWT.CUSTOM_VARIANT);
+ textViewer.setParagraphStyle((Paragraph) currentTextPart, style == null ? null : style.toString());
+// }
+// } else if (eventSource == deleteButton) {
+// textViewer.deletePart((SectionPart) currentTextPart);
+// } else if (eventSource == editButton) {
+// textViewer.getCmsEditable().startEditing();
+// } else if (eventSource == publishButton) {
+// textViewer.getCmsEditable().stopEditing();