public GroupChatNickEditFrame(final XmppAccountRoot xmppAccountRoot, final XmppItem xmppItem) {
    super(MidletMain.screen);
    /** Accepting variables * */
    this.xmppAccountRoot = xmppAccountRoot;
    this.xmppItem = xmppItem;
    /** Header * */
    header = new Header(Localization.getMessage("GROUP_CHAT_NICK_EDIT"));
    /** Soft * */
    soft = new Soft(MidletMain.screen);
    /** Left soft items * */
    soft.leftSoft =
        new PopupItem(Localization.getMessage("BACK")) {

          public void actionPerformed() {
            MidletMain.screen.setActiveWindow(s_prevWindow);
          }
        };
    /** Right soft items * */
    soft.rightSoft =
        new PopupItem(Localization.getMessage("APPLY")) {

          public void actionPerformed() {
            try {
              XmppSender.sendPresence(
                  xmppAccountRoot.xmppSession.xmlWriter,
                  null,
                  xmppItem.userId.concat("/").concat(nickField.getText()),
                  null,
                  XmppStatusUtil.getStatusDescr(xmppAccountRoot.statusIndex),
                  null,
                  5,
                  false,
                  null,
                  null);
              xmppItem.groupChatNick = nickField.getText();
            } catch (IOException ex) {
            }
            MidletMain.screen.setActiveWindow(s_prevWindow);
          }
        };
    /** Pane * */
    Pane pane = new Pane(null, false);
    pane.addItem(new Label(Localization.getMessage("NICK_NAME")));
    nickField = new Field(xmppItem.groupChatNick);
    nickField.setFocusable(true);
    nickField.setFocused(true);
    pane.addItem(nickField);
    /** Setting GObject * */
    setGObject(pane);
  }
Example #2
0
 public void startApp() {
   LogUtil.outMessage("startApp invoked");
   /** Core * */
   version = getAppProperty("MIDlet-Version");
   type = getAppProperty("Type");
   build = getAppProperty("Build");
   /** Main * */
   midletMain = this;
   /** Logger for debugging * */
   LogUtil.initLogger(true, false, "92.36.93.99", 2000, false, "");
   /** Initialize localization support * */
   Localization.initLocalizationSupport();
   /** GUI* */
   screen = new Screen(this);
   /** Loading storage data * */
   Storage.init();
   Storage.load();
   /** Loading settings * */
   Settings.loadAll();
   /** Loading icons * */
   Splitter.splitImage(Settings.IMG_CHAT);
   Splitter.splitImage(Settings.IMG_STATUS);
   Splitter.splitImage(Settings.IMG_SUBSCRIPTION);
   /** Loading theme * */
   Theme.checkForUpSize();
   int[] data = Theme.loadTheme(Settings.themeOfflineResPath);
   if (data != null) {
     Theme.applyData(data);
   }
   /** GUI * */
   mainFrame = new MainFrame();
   chatFrame = new ChatFrame();
   roomsFrame = null;
   /** Frames chain * */
   mainFrame.s_nextWindow = chatFrame;
   chatFrame.s_prevWindow = mainFrame;
   /** Setting up active window * */
   screen.activeWindow = mainFrame;
   /** Showing * */
   screen.show();
   /** Checking for main frame object * */
   if (mainFrame.getGObject().equals(mainFrame.blank)) {
     /** Showing warning * */
     Handler.showWarning("TEST_VERSION");
   }
 }