Ejemplo n.º 1
0
 @IsDirty
 public boolean isDirty() {
   if (isReadOnly) {
     return false;
   }
   return (view.isDirty() || importsWidget.isDirty() || metadataWidget.isDirty());
 }
Ejemplo n.º 2
0
 @OnMayClose
 public boolean checkIfDirty() {
   if (isDirty()) {
     return view.confirmClose();
   }
   return true;
 }
Ejemplo n.º 3
0
  @OnSave
  public void onSave() {
    if (isReadOnly) {
      view.alertReadOnly();
      return;
    }

    new SaveOperationService()
        .save(
            path,
            new CommandWithCommitMessage() {
              @Override
              public void execute(final String comment) {
                factModelService
                    .call(
                        new RemoteCallback<Path>() {
                          @Override
                          public void callback(final Path response) {
                            view.setNotDirty();
                            metadataWidget.resetDirty();
                            notification.fire(
                                new NotificationEvent(
                                    CommonConstants.INSTANCE.ItemSavedSuccessfully()));
                          }
                        })
                    .save(path, view.getContent(), metadataWidget.getContent(), comment);
              }
            });
  }