public void revert() { try { editor.discard(); } catch (EditorException e) { log.warn("Unable to discard the document in the editor", e); throw new RuntimeException("Unable to discard the document in the editor", e); } }
public void discard() throws EditorException { final IEditor editor = getEditor(); if (editor != null) { editor.discard(); } }
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { final Consumer<Tab> discardAndClose = currentTab -> { final IEditor editor = currentTab.getEditor(); if (editor != null) { try { if (editor.isModified()) { editor.discard(); ///discard the document and switch to VIEW mode } editor.close(); } catch (EditorException e) { log.error("Unable to discard/close the document {}", e.getMessage()); } } }; processAllTabs(discardAndClose); updateDialog(target); } });