mvccomponent.java.svn-base

来自「j2me mobile application for upload file 」· SVN-BASE 代码 · 共 55 行

SVN-BASE
55
字号
package org.celllife.clforms; import javax.microedition.lcdui.Alert;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.CommandListener;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import de.enough.polish.util.Locale;public abstract class MVCComponent implements CommandListener {//  protected static Displayable screen = null;  // Set from outside at beginning  public static Display display;  // Returns the screen object from the derived class  public abstract Displayable getScreen();  public Displayable prepareScreen () throws Exception {    if ( getScreen() == null ) {      initModel();      createView();    } else {      updateView();    }    getScreen().setCommandListener ( (CommandListener) this );    return getScreen ();  }  public void showScreen() {    try {      display.setCurrent( prepareScreen());    } catch (Exception e) {      e.printStackTrace();      Alert a = new Alert(Locale.get("error.screen")); //$NON-NLS-1$      a.setString(e.getMessage());      a.setTimeout(Alert.FOREVER);      display.setCurrent(a);    }  }  // Initialize. If a data member is not backed by RMS, make sure  // it is uninitilzed (null) before you put in values.  protected abstract void initModel () throws Exception;  protected abstract void createView () throws Exception;  protected abstract void updateView () throws Exception;  public abstract void commandAction(Command c, Displayable s);}

⌨️ 快捷键说明

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