public void setDocument(final Document document) { current = document; if (document != null) { // Fill up the form with the document details view.setId(document.getId()); view.setType(document.getType()); view.setName(document.getName()); view.setDescription(document.getDescription()); view.setContent(document.getContent()); view.setNewDocument(document.isNew()); attributesDataProvider.setList(document.getAttributes()); // Make the view visible view.asWidget().setVisible(true); } else { // Clear the form and hide the view view.asWidget().setVisible(false); } }
public void doCancel() { if (current == null) { return; } if (current.isNew()) { // clear temporal document and hide the view documentManagerLiaison.remove(current); view.clear(); view.asWidget().setVisible(false); attributesDataProvider.getList().clear(); current = null; } else { // reset the view to the current data setDocument(current); } }