/** * @param ureq * @param control */ public GlossaryDefinitionController( UserRequest ureq, WindowControl control, GlossaryItem glossaryItem) { super(ureq, control); this.glossaryItem = glossaryItem; String glossDef = glossaryItem.getGlossDef(); wCtrl = WysiwygFactory.createWysiwygControllerWithoutFile(ureq, control, null, glossDef, null); wCtrl.getRichTextConfiguration().disableMathEditor(); listenTo(wCtrl); putInitialPanel(wCtrl.getInitialComponent()); }
@Override public void event(UserRequest ureq, Controller source, Event event) { if (source == wCtrl) { if (event == Event.DONE_EVENT) { String glossDef = wCtrl.getHTMLContent(); glossDef = glossDef.replaceAll(System.getProperty("line.separator"), ""); glossaryItem.setGlossDef(glossDef); } else if (event == Event.CANCELLED_EVENT) { // nothing to do, editor handles this itself. changes aren't persisted without clicking // "save" // getWindowControl().getWindowBackOffice().getWindow().setDirty(true); } } }
/** @see org.olat.core.gui.control.DefaultController#doDispose() */ @Override protected void doDispose() { // nothing to do wCtrl.dispose(); }