📄 message.java
字号:
/* * Copyright 2004 Grzegorz Grasza groz@gryf.info * * This file is part of mobber. Mobber 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. * Mobber 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 mobber; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA . */import javax.microedition.lcdui.*;public class Message extends Form implements CommandListener{ Displayable current; String jid; boolean flee = false; public Message() { super(Label.received); addCommand(Action.back); addCommand(Action.send); addCommand(Action.add); addCommand(Action.delmsg); setCommandListener(this); } public void add(String jid, String message) { this.jid = jid; String name = (String)mobber.roster.names.get(jid); append(new StringItem((name == null ? jid : name) + ':', message)); if(!mobber.display.getCurrent().equals(this)) { current = mobber.display.getCurrent(); flee = false; } mobber.display.setCurrent(this); while(size() > 12) delete(0); } public void show() { current = mobber.display.getCurrent(); flee = false; mobber.display.setCurrent(this); } public void commandAction(Command c,Displayable s) { if(c == Action.back) { if(flee) mobber.display.setCurrent(mobber.roster); else { mobber.display.setCurrent(current); flee = true; } } else if(c == Action.send) mobber.display.setCurrent(new NewMessage (jid)); else if(c == Action.add) mobber.display.setCurrent(new SetContact(jid)); else if(size() != 0) delete(0); }};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -