code: public void onBeforeSetEditorMode(final EditorMode mode) {
  
          EditorMode oldMode = m_editorMode;
          if ((oldMode == EditorMode.categories) && ((mode == EditorMode.vfs) || (mode == EditorMode.navigation))) {
              final CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
  
                  @Override
                  public void execute() {
  
                      start(200, true);
                      getController().refreshRoot(this);
                  }
  
                  @Override
                  protected void onResponse(Void result) {
  
                      stop(false);
                      setEditorMode(mode);
                  }
              };
              action.execute();
          } else {
              setEditorMode(mode);
          }
  
      }
docs: Performs necessary async actions before actually setting the mode.<p>
  
  @param mode the mode