example.mia.demo
Class MicroLexicon

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.mia.demo.MicroLexicon
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class MicroLexicon
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener

MicroLexicon midlet is an example for JSR238 (Mobile Internationalization API)

See Also:
JSR238 Spec Example uses device resources of the emulator as well as application resources bundled with the application.
To see content of device resource files use manager WTK_HOME/bin/i18ntool.. To see content of application resource files use i18n Resource Manager from ktoolbar, look into menu project. Application resources are placed under example's /res directory. You will see how easy is to add your own language to the lexicon ;-)

Nested Class Summary
(package private) static class MicroLexicon.Languages
          Helper class holds language names, locale codes and flags all in one.
 
Field Summary
(package private)  javax.microedition.lcdui.Command backCommand
           
(package private)  javax.microedition.lcdui.Displayable currentDisplay
          currently visible screen
(package private) static javax.microedition.global.ResourceManager devManager
          device resources manager
(package private)  javax.microedition.lcdui.Command exitCommand
          commands definitions
(package private)  javax.microedition.lcdui.Image flag
          flag selected
(package private)  javax.microedition.lcdui.Form frmLangChooser
          screens lazy initialize
(package private)  javax.microedition.lcdui.Form frmTranslate
           
(package private)  java.lang.String language
          language selected
(package private)  MicroLexicon.Languages languages
          languages available
(package private)  javax.microedition.lcdui.List lstPhraseChooser
           
(package private)  javax.microedition.lcdui.Command nextCommand
           
(package private)  java.lang.String phrase
          phrase selected
(package private)  int phraseId
           
(package private) static java.lang.String[] phrases
          Phrases are read from resources but the array is initialized with defaults (english)
(package private) static javax.microedition.global.ResourceManager phrasesManager
          resources manager for accessing phrases
(package private) static javax.microedition.global.ResourceManager targetPhrasesManager
          Resource Manager of target language
(package private) static javax.microedition.global.ResourceManager uiManager
          resources manager for accessing ui resources
 
Constructor Summary
MicroLexicon()
           
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable)
           
 void destroyApp(boolean unconditional)
           
 void pauseApp()
           
 void startApp()
          Start application.
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

phrases

static final java.lang.String[] phrases
Phrases are read from resources but the array is initialized with defaults (english)


targetPhrasesManager

static javax.microedition.global.ResourceManager targetPhrasesManager
Resource Manager of target language


phrasesManager

static javax.microedition.global.ResourceManager phrasesManager
resources manager for accessing phrases


uiManager

static javax.microedition.global.ResourceManager uiManager
resources manager for accessing ui resources


devManager

static javax.microedition.global.ResourceManager devManager
device resources manager


languages

MicroLexicon.Languages languages
languages available


currentDisplay

javax.microedition.lcdui.Displayable currentDisplay
currently visible screen


frmLangChooser

javax.microedition.lcdui.Form frmLangChooser
screens lazy initialize


lstPhraseChooser

javax.microedition.lcdui.List lstPhraseChooser

frmTranslate

javax.microedition.lcdui.Form frmTranslate

language

java.lang.String language
language selected


flag

javax.microedition.lcdui.Image flag
flag selected


phrase

java.lang.String phrase
phrase selected


phraseId

int phraseId

exitCommand

javax.microedition.lcdui.Command exitCommand
commands definitions


nextCommand

javax.microedition.lcdui.Command nextCommand

backCommand

javax.microedition.lcdui.Command backCommand
Constructor Detail

MicroLexicon

public MicroLexicon()
Method Detail

startApp

public void startApp()
Start application. By default initialized with form for choosing languages

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

public void pauseApp()
Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

public void destroyApp(boolean unconditional)
Specified by:
destroyApp in class javax.microedition.midlet.MIDlet

commandAction

public void commandAction(javax.microedition.lcdui.Command command,
                          javax.microedition.lcdui.Displayable displayable)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener