Beispiel #1
0
  public void menuSelect(Menu menu, byte action) {
    switch (action) {
      case MENU_CONTACTMENU:
        if (uins.size() < 1) {
          return;
        }
        String uincm = (String) uins.elementAt(getCurrTextIndex());
        ContactItem cItemcm;
        if (profile.getItemByUIN(uincm) == null) {
          cItemcm = profile.createTempContact(uincm);
        } else {
          cItemcm = profile.getItemByUIN(uincm);
        }
        Menu mc = new Menu(this, (byte) 1);
        JimmUI.fillContactMenu(cItemcm, mc);
        Jimm.setPrevScreen(getVisibleObject());
        Jimm.setDisplay(mc);
        return;
        // #sijapp cond.if modules_DEBUGLOG is "true"#
      case MENU_DEBUGLOG:
        DebugLog.activateEx();
        return;
        // #sijapp cond.end#
      case MENU_OPTIONS:
        new OptionsEye(this);
        return;
      case MENU_COPYTEXT:
      case MENU_COPY_ALLTEXT:
        JimmUI.setClipBoardText(getCurrText(0, (action == MENU_COPY_ALLTEXT)));
        break;

      case MENU_COPYUIN:
        JimmUI.setClipBoardText((String) uins.elementAt(getCurrTextIndex()));
        break;

      case MENU_CLEAR:
        boolean needRemoveCommands = uins.size() > 0;
        idx = 0;
        uins = null;
        uins = new Vector();
        lock();
        if (uins.size() == 0 && needRemoveCommands) {
          removeCommandEx(JimmUI.cmdMenu);
        }
        clear();
        setColorScheme();
        unlock();
        break;
    }

    if (menu != null) {
      menu.back();
    }
  }
Beispiel #2
0
 private void showMenu() {
   Menu menu = new Menu(this);
   if (uins.size() > 0) {
     menu.addMenuItem("user_menu", MENU_CONTACTMENU);
   }
   // #sijapp cond.if modules_DEBUGLOG is "true"#
   menu.addMenuItem("*DebugList*", MENU_DEBUGLOG);
   // #sijapp cond.end#
   if (uins.size() > 0) {
     menu.addMenuItem("copy_text", MENU_COPYTEXT);
     menu.addMenuItem("copy_uin", MENU_COPYUIN);
     menu.addMenuItem("copy_all_text", MENU_COPY_ALLTEXT);
   }
   menu.addMenuItem("options_lng", MENU_OPTIONS);
   if (uins.size() > 0) {
     menu.addMenuItem("clear", MENU_CLEAR);
   }
   menu.setMenuListener(this);
   Jimm.setDisplay(menu);
 }