Package com.tensegrity.wpalo.client.ui.editor

Examples of com.tensegrity.wpalo.client.ui.editor.CloseObserver


            new Listener<WindowEvent>() {
              public void handleEvent(WindowEvent be) {
                if (be.buttonClicked.getItemId()
                    .equalsIgnoreCase(Dialog.YES)) {
                  ((ViewBrowserEditor) currentEditor).setUnDirty();
                  currentEditor.close(new CloseObserver() {
                    public void finishedClosed() {
                      ((ViewBrowserEditor) currentEditor).setCloseAll(false);
                      callback.onSuccess(true);
                    }
                  });
                  return;
                } else if (be.buttonClicked.getItemId().equalsIgnoreCase(Dialog.NO)) {
                  if (callback != null) {
                    callback.onSuccess(false);
                  }
                  return;
                }
                if (callback != null) {
                  callback.onSuccess(true);
                }
              }
            });                       
      } else {
        if (callback != null) {
          callback.onSuccess(true);
        }
      }
      return;
    }
    if (currentEditor != null && currentEditor.isDirty() &&
        (!currentEditor.equals(newEditor) || !(currentEditor instanceof ViewBrowserEditor))) {
      String messageText = messages.saveEditorBeforeClosing(currentEditor.getTitle());
      if (currentEditor.getTitle().equals(constants.views())) {
        messageText = constants.closeModifiedViewHint();
      }
      MessageBoxUtils.yesNoCancel(constants.saveEditor(), messageText,
          new Listener<WindowEvent>() {
            public void handleEvent(WindowEvent be) {
              if (be.buttonClicked.getItemId()
                  .equalsIgnoreCase(Dialog.YES)) {
                currentEditor.doSave(callback);
                return;
              } else if (be.buttonClicked.getItemId().equalsIgnoreCase(Dialog.NO)) {
                if (currentEditor instanceof ViewBrowserEditor) {
                  ((ViewBrowserEditor) currentEditor).setUnDirty();
                  currentEditor.close(new CloseObserver() {
                    public void finishedClosed() {
                      ((ViewBrowserEditor) currentEditor).setCloseAll(false);
                      callback.onSuccess(true);
                    }
                  });
View Full Code Here


    this.user = user;
  }
 
  final void checkForLogout() {
    final IEditor editor = currentEditor;
    final CloseObserver observer = new CloseObserver() {
      public void finishedClosed() {
        Dispatcher.forwardEvent(WPaloEvent.LOGOUT);
      }
    };
    editor.beforeClose(new AsyncCallback<Boolean>() {
View Full Code Here

//      viewpanel.removeFromParent();     
    }
    user = null;
  }
  private final void closeOnLogout(IEditor editor) {
    CloseObserver observer = new CloseObserver() {
      public void finishedClosed() {
        Dispatcher.forwardEvent(WPaloEvent.APP_STOP);
      }
    };
    close(editor, observer);
View Full Code Here

TOP

Related Classes of com.tensegrity.wpalo.client.ui.editor.CloseObserver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.