?? searchphoneui.java
字號:
package com.hziee.phone_book.ui;
import javax.microedition.lcdui.*;
/**搜索功能界面*/
public class SearchPhoneUI extends Form implements CommandListener,ItemStateListener
{
private UIController uicontroller;
private TextField inputField;
public static final Command backCommand = new Command("返回",Command.BACK,2);
public static final Command searchCommand = new Command("搜索",Command.OK,1);
public SearchPhoneUI(UIController uicontroller)
{
super(Title.search);
this.uicontroller = uicontroller;
inputField = new TextField(Title.name, null, 20,
TextField.ANY);
this.append(inputField);
this.addCommand(backCommand);
this.addCommand(searchCommand);
this.setCommandListener(this);
this.setItemStateListener(this);
}
public void init()
{
inputField.setString("");
}
public void commandAction(Command arg0, Displayable arg1)
{
// TODO Auto-generated method stub
if(arg0 == backCommand)
{//返回到IndexFunctionUI
uicontroller.handleEvent(UIController.EventID.EVENT_SEARCHUI_BACK_MAINNUI);
}
else if(arg0 == searchCommand)
{
String userName = inputField.getString();
if(userName.length()!= 0)
{
uicontroller.handleEvent(UIController.EventID.EVENT_SEARCH_RECORD_ANYWAY,new Object[]{userName});
}
}
}
public void itemStateChanged(Item item)
{
if(item == inputField)
{
String userName = inputField.getString();
if(userName.length()!= 0)
{
uicontroller.handleEvent(UIController.EventID.EVENT_SEARCH_RECORD,new Object[]{userName});
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -