www.pudn.com > WordTip.zip > AlertUI.java
/*
* Created on 2005-1-30
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package net.hyweb.ui;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.Image;
/**
* @author user
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class AlertUI extends Alert implements CommandListener{
private UIController uicontroller;
private Command yesCommand = null;
private Command noCommand = null;
private Object[] object = null;
/**
* @param arg0
* @param arg1
* @param arg2
* @param arg3
*/
public AlertUI(String title, String text, Image image, AlertType type) {
super(title, text, image, type);
}
public void commandAction(Command command, Displayable arg1) {
if(command == yesCommand){
uicontroller.EventController(EventID.DELETE_WORD_YES, object);
}else if(command == noCommand){
uicontroller.EventController(EventID.VIEW_ALL);
}
else{
System.out.println("Error Operation");
uicontroller.EventController(EventID.UI_MAIN);
}
}
/**
* @return Returns the noCommand.
*/
public Command getNoCommand() {
return noCommand;
}
/**
* @param noCommand The noCommand to set.
*/
public void setNoCommand(Command noCommand) {
this.noCommand = noCommand;
}
/**
* @return Returns the yesCommand.
*/
public Command getYesCommand() {
return yesCommand;
}
/**
* @param yesCommand The yesCommand to set.
*/
public void setYesCommand(Command yesCommand) {
this.yesCommand = yesCommand;
}
/**
* @param uicontroller The uicontroller to set.
*/
public void setUicontroller(UIController uicontroller) {
this.uicontroller = uicontroller;
}
/**
* @param object The object to set.
*/
public void setObject(Object[] object) {
this.object = object;
}
/**
* @return Returns the object.
*/
public Object[] getObject() {
return object;
}
/**
* @return Returns the uicontroller.
*/
public UIController getUicontroller() {
return uicontroller;
}
}