⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listselectservice.java

📁 goText is a program for mobile phones that allows you to send text messages over GPRS/EDGE/UMTS. It
💻 JAVA
字号:
/**
 * Class : short description
 * @author Michele 'Miccar' Cardinale miccar@gmail.com
 * @author Natale Vinto ebballon@interfree.it
 * @version 1.0
 */

 /*
  *  goText : text messaging over GPRS
  *  Copyright (C) 2006  Natale Vinto <ebballon@interfree.it>
  *  OpenJLab Group www.openjlab.org
  *  Copyright (C) 2006  Michele Cardinale 'Miccar' <miccar@gmail.com>
  *  www.miccar.org
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *      GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */

import javax.microedition.lcdui.*;

public class ListSelectService extends List implements CommandListener{
    
    protected goText gotext;
    protected Lang l;
    private Command command_back;
    
    public ListSelectService(goText gotext) {
        super("",List.IMPLICIT);
        this.gotext=gotext;
        l=new Lang(gotext.lang);
        this.setTitle(l.LMS_TITLE);
        this.start();
    }

    private void start(){
        this.setTitle(l.LMS_TITLE+" : "+gotext.services.length);
        if(gotext.services.length==0){
            this.setTicker(new Ticker(l.LSS_NOSERVICE));
        } else {
            Image ico_yes=null,ico_no=null;
            try{
                ico_yes = Image.createImage("/img/ok.png");
                ico_no = Image.createImage("/img/no.png");
            } catch (Exception e){}
            for(int i=0;i<gotext.services.length;i++){
                Service s=gotext.services[i];
                if(s.isConfigured())
                    this.append("["+s.getSentMsg()+"/"+s.getMaxMsg()+"] "+s.getName(), ico_yes);
                else
                    this.append(gotext.services[i].getName(), ico_no);
            }
        }
        command_back=new Command(l.COMMAND_BACK,Command.BACK,1);
        this.addCommand(command_back);
        this.setCommandListener(this);
        this.show();
    }
    
    public void show(){
        gotext.display.setCurrent(this);
    }
    
    public void commandAction(Command c, Displayable d){
        if (c==List.SELECT_COMMAND){
            if(this.getSelectedIndex()>=0){
                if(gotext.services[this.getSelectedIndex()].isConfigured()){
                    new ListMessages(gotext,gotext.services[this.getSelectedIndex()]);
                } else {
                    utils.popup(l.ALERT_WARNING_TITLE,l.ALERT_WARNING9,gotext,AlertType.WARNING);
                }
            }
        }else if (c==command_back){
            gotext.mc.show();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -