예제 #1
0
 @IsDirty
 public boolean isDirty() {
   if (isReadOnly) {
     return false;
   }
   return (view.isDirty() || metadataWidget.isDirty());
 }
예제 #2
0
 @OnMayClose
 public boolean checkIfDirty() {
   if (isDirty()) {
     return view.confirmClose();
   }
   return true;
 }
예제 #3
0
  @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);
              }
            });
  }