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

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


      break;
    case EXPANDED_REPORT_STRUCTURE_SECTION:
      forwardToView(navigatorView, event);
      break;
    case UPDATE_WORKBOOKS:
      IEditor ed = getEditor(WPaloEvent.EDIT_REPORT_STRUCTURE);
      if (ed != null) {
        ((ReportStructureEditor) ed).reload((XObject) event.data);
      }
      break;
    case EDIT_REPORT_STRUCTURE:
      IEditor editor = getEditor(event.type);
      editor.setInput(event.data);
      Workbench wb = (Workbench) Registry.get(Workbench.ID);
      wb.open(editor);
      break;
    case SET_EDITOR_INPUT:
      IEditor edi = getEditor(WPaloEvent.EDIT_REPORT_STRUCTURE);
      edi.setInput(event.data);
      break;
    case LOGOUT: initialized = false;
          break;     
    }
  }
View Full Code Here


    case EDIT_CONNECTION_ITEM:
      final Workbench wb = (Workbench)Registry.get(Workbench.ID);
//      if (wb.getCurrentEditor() != null &&
//        wb.getCurrentEditor().isDirty()) {
//      }
      final IEditor editor = getEditor(event.type);
      wb.checkOpen(editor, new Callback<Boolean>(){
        public void onSuccess(Boolean result) {
          if (result) {
            editor.setInput(event.data);               
            wb.open(editor);           
          }
        }
      });
      break;
View Full Code Here

      return connectionEditor;
  }

  private final void doAdd(int eventType) {
    Object input = null;
    IEditor editor = null;
    switch(eventType) {
    case ADD_ACCOUNT_ITEM:
      input = new TreeNode(null, new XAccount());
      editor = accountEditor;
      break;
    case ADD_CONNECTION_ITEM:
      input = new TreeNode(null, new XConnection());
      editor = connectionEditor;
      break;
    }
   
    final Workbench wb = (Workbench)Registry.get(Workbench.ID);
    final IEditor edi = editor;
    final Object inp = input;
    wb.checkOpen(edi, new Callback<Boolean>(){
      public void onSuccess(Boolean result) {
        if (result) {
          edi.setInput(inp);
          wb.open(edi);
          edi.selectFirstTab();
          edi.setTextCursor();
          if (edi.equals(accountEditor)) {
            ((AccountEditor) edi).prefillFields();
          }
        }
      }
    });
View Full Code Here

      break;
    case EDIT_GROUP_ITEM:
    case EDIT_ROLE_ITEM:
    case EDIT_USER_ITEM:
      final Workbench wb = (Workbench)Registry.get(Workbench.ID);
      final IEditor editor = getEditor(event.type);
      wb.checkOpen(editor, new Callback<Boolean>() {
        public void onSuccess(Boolean result) {
          if (result) {
            editor.setInput(event.data);     
            wb.open(editor);
          }
        }
      });         
      break;
View Full Code Here

  }
 
  private final void doAdd(int eventType) {
    try {
    Object input = null;
    IEditor editor = null;
    switch(eventType) {
    case ADD_GROUP_ITEM:
      input = new TreeNode(null, new XGroup());
      editor = grpEditor;
      break;
    case ADD_ROLE_ITEM:
      input = new TreeNode(null, new XRole());
      editor = roleEditor;
      break;
    case ADD_USER_ITEM:
      XUser user = ((Workbench) Registry.get(Workbench.ID)).getUser();
      String sessionId = user.getSessionId();
      WPaloAdminServiceProvider.getInstance().getRoles(sessionId, user,
          new Callback<XRole[]>(constants.loadingAllRolesFailed()) {
            public void onSuccess(XRole[] result) {
              XUser newXUser = new XUser();
              final Object input = new TreeNode(null, newXUser);
              for (XRole r: result) {
                if (r.getName().equalsIgnoreCase("editor")) {
                  newXUser.addRoleID(r.getId());
                  newXUser.addRoleName(r.getId(), r.getName());
                }
                if (r.getName().equalsIgnoreCase("viewer")) {
                  newXUser.addRoleID(r.getId());
                  newXUser.addRoleName(r.getId(), r.getName());
                }
              }
              final Workbench wb = (Workbench)Registry.get(Workbench.ID);
              wb.checkOpen(usrEditor, new Callback<Boolean>() {
                public void onSuccess(Boolean result) {
                  if (result) {
                    IEditor editor = usrEditor;
                    editor.setInput(input);                 
                    wb.open(editor);
                    editor.selectFirstTab();
                    editor.setTextCursor();
                  }
                }
              });
            }           
          });
      break;
    }   
    if (input != null && editor != null) {
      final Workbench wb = (Workbench)Registry.get(Workbench.ID);
      final IEditor edi = editor;
      final Object inp = input;
      wb.checkOpen(edi, new Callback<Boolean>() {
        public void onSuccess(Boolean result) {
          if (result) {
            edi.setInput(inp);     
            wb.open(edi);
            edi.selectFirstTab();
            edi.setTextCursor();           
          }
        }
      });
    }
    } catch (Throwable t) {
View Full Code Here

    registerEventTypes(EDIT_TEMPLATE_ITEM, EDIT_TEMPLATE_VIEW,
        EXPANDED_REPORT_SECTION, UPDATE_WORKBOOKS, SHOW_TEMPLATE_VIEW);
  }
 
  public void handleEvent(AppEvent<?> event) {
    IEditor editor;
    Workbench wb = (Workbench) Registry.get(Workbench.ID);
   
    switch(event.type) {
    case INIT:
      forwardToView(navigatorView, event);
View Full Code Here

    case EXPANDED_SERVER_SECTION:
      forwardToView(navigatorView, event);
      break;
    case EDIT_DIMENSION_ITEM:
    case EDIT_SERVER_ITEM:
      IEditor editor = getEditor(event.type);
      editor.setInput(event.data);
      Workbench wb = (Workbench)Registry.get(Workbench.ID);
      wb.open(editor);
      break;
    case LOGOUT: initialized = false;
      break;
View Full Code Here

      break;
    case EXPANDED_VIEW_REPORT_STRUCTURE_SECTION:
      forwardToView(navigatorView, event);
      break;
    case VIEW_REPORT_EVENT:
      IEditor editor = getEditor(event.type);
      editor.setInput(event.data);
      ViewModeWorkbench wb = (ViewModeWorkbench)
        Registry.get(ViewModeWorkbench.ID);
      wb.open(editor);
      break;
    case LOGOUT: initialized = false;
View Full Code Here

  public final void directLogin(XUser user) {
    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>() {
      public void onSuccess(Boolean result) {
        if (result) {
          editor.close(observer);           
          editorpanel.setHeading("");
          editorpanel.removeAll();
        }
      }
     
View Full Code Here

TOP

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

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.