private void switchAccount(boolean login) {
   if (!login) parentView = StaticData.getInstance().roster;
   destroyView();
   Config cf = Config.getInstance();
   cf.accountIndex = cursor;
   cf.saveToStorage();
   Account.loadAccount(login);
 }
  /** Creates a new instance of AccountPicker */
  public AccountSelect(Display display, boolean enableQuit) {
    super();
    // this.display=display;

    setTitleItem(new Title(SR.MS_ACCOUNTS));

    accountList = new Vector();
    Account a;

    int index = 0;
    activeAccount = Config.getInstance().accountIndex;
    do {
      a = Account.createFromStorage(index);
      if (a != null) {
        accountList.addElement(a);
        a.active = (activeAccount == index);
        index++;
      }
    } while (a != null);
    if (accountList.isEmpty()) {
      a = Account.createFromJad();
      if (a != null) {
        // a.updateJidCache();
        accountList.addElement(a);
        rmsUpdate();
      }
    }
    attachDisplay(display);
    addCommand(cmdAdd);

    if (enableQuit) addCommand(cmdQuit);

    commandState();
    setCommandListener(this);
  }
 /** Creates a new instance of GroupChatForm */
 public ConferenceForm(Display display) {
   String room = Config.getInstance().defGcRoom;
   String server = null;
   // trying to split string like room@server
   int roomE = room.indexOf('@');
   if (roomE > 0) {
     server = room.substring(roomE + 1);
     room = room.substring(0, roomE);
   }
   // default server
   if (server == null) server = "conference." + sd.account.getServer();
   createForm(display, room, server, null, null);
 }