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

📄 indexfunctionui.java

📁 手机通讯录源码 JAVA版本 本游戏来源于网络
💻 JAVA
字号:
/*
 * Created on 2004-6-20
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.north.phonebook.ui;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

/**
 * @author P2800
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class IndexFunctionUI extends List implements CommandListener
{

    private UIController uicontroller;
    public static final int INC = 100; 

    public static class ListIndex
    {
        public static final byte ADD_NEW_RECORD = 100;
        public static final byte SEARCH_RECORD = 101;
        public static final byte CLEAR_RECORD = 102;
        public static final byte LIST_RECORD = 103;
        public static final byte HELP = 104;
    }

    public IndexFunctionUI(UIController uicontroller)
    {
        super(Title.listTitle, List.IMPLICIT, Title.menu, null);
        this.uicontroller = uicontroller;
        this.setCommandListener(this);
    }

    /*
     * (non-Javadoc)
     * 
     * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
     *      javax.microedition.lcdui.Displayable)
     */
    public void commandAction(Command arg0, Displayable arg1)
    {
        // TODO Auto-generated method stub
        if (arg0 == List.SELECT_COMMAND)
        {
            int index = this.getSelectedIndex();
            switch (index+INC)
            {
            case ListIndex.ADD_NEW_RECORD:
                uicontroller.handleEvent(ListIndex.ADD_NEW_RECORD);
                break;
            case ListIndex.SEARCH_RECORD:
                uicontroller.handleEvent(ListIndex.SEARCH_RECORD);
                break;
            case ListIndex.CLEAR_RECORD:
                uicontroller.handleEvent(ListIndex.CLEAR_RECORD);
                break;
            case ListIndex.LIST_RECORD:
                uicontroller.handleEvent(ListIndex.LIST_RECORD);
                break;
            case ListIndex.HELP:
                System.out.println(Title.menu[index]);
                break;
            default:
                break;
            }

        }

    }

}

⌨️ 快捷键说明

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