@IsDirty public boolean isDirty() { if (isReadOnly) { return false; } return (view.isDirty() || metadataWidget.isDirty()); }
@OnMayClose public boolean checkIfDirty() { if (isDirty()) { return view.confirmClose(); } return true; }
@OnSave public void onSave() { if (isReadOnly) { view.alertReadOnly(); return; } new SaveOperationService() .save( path, new CommandWithCommitMessage() { @Override public void execute(final String comment) { globalsEditorService .call( new RemoteCallback<Path>() { @Override public void callback(final Path response) { view.setNotDirty(); metadataWidget.resetDirty(); notification.fire( new NotificationEvent( CommonConstants.INSTANCE.ItemSavedSuccessfully())); } }) .save(path, model, metadataWidget.getContent(), comment); } }); }