New classes and methods

In this section, all the class and method level changes have been listed. It covers the new APIs in the com.nokia.lwuit package, new methods added to the original LWUIT classes in com.sun.lwuit package, and information on the areas where the API is unmodified but it has been modified to use Series 40 platform implementation.

New APIs

LWUIT for Series 40 library has an additional package com.nokia.lwuit that does not exist in the original LWUIT. This package contains classes for accessing Nokia proprietary APIs and some utility classes.

Most of the Nokia proprietary APIs are accessed via wrappers using indirect references to the classes, so the application does not crash when using the APIs on older Series 40 devices where the APIs might not exist. Note, however, that you should not rely on the existence of com.nokia.lwuit package and its classes if you want to maintain API compatibility with the original LWUIT.

Here is a list of the classes in com.nokia.lwuit package:

  • com.nokia.lwuit.CategoryBarProvider

  • com.nokia.lwuit.Dbug

  • com.nokia.lwuit.DirectUtilsProvider

  • com.nokia.lwuit.GestureHandler

  • com.nokia.lwuit.ImageUtils

  • com.nokia.lwuit.MIDPCommandWrapper

  • com.nokia.lwuit.OrientationListener

  • com.nokia.lwuit.OrientationProvider

  • com.nokia.lwuit.TextEditorProvider

  • com.nokia.lwuit.components.ContextMenu

  • com.nokia.lwuit.components.PopupChoiceGroup

  • com.nokia.lwuit.templates.list.BasicListItem

  • com.nokia.lwuit.templates.list.NokiaListCellRenderer

New methods in existing LWUIT classes

LWUIT for Series 40 has also some added functionality in the classes under com.sun.lwuit package. If you need to maintain compatibility with the original LWUIT, you should avoid using those methods directly.

Class

Added methods

com.sun.lwuit.Dialog

  • public boolean getDisposeOnRotation()

  • public void setDisposeOnRotation(boolean)

com.sun.lwuit.Display

  • public int getDeviceType()

  • public com.sun.lwuit.util.Resources getNokiaResource()

  • public java.lang.Object getObjectTrait(java.lang.Object, java.lang.String)

  • public java.lang.Object getObjectTrait(java.lang.Object, java.lang.String)

com.sun.lwuit.EncodedImage

  • public java.lang.Object getImage()

com.sun.lwuit.Form

  • protected void clearTextFieldFocus()

  • public com.sun.lwuit.Command getSelectCommand()

  • public void setSelectCommand(com.sun.lwuit.Command)

com.sun.lwuit.Label

  • public void setSize(com.sun.lwuit.geom.Dimension)

  • public void setWidth(int)

com.sun.lwuit.MenuBar

  • public com.sun.lwuit.Command[] getSoftCommands()

  • public boolean isMenuBarInstalled()

  • protected boolean isNativeCommandBehavior()

com.sun.lwuit.Slider

  • public int getSliderValue()

  • public void setSliderValue(int)

  • public void setText(java.lang.String)

com.sun.lwuit.TextArea

  • protected void deinitialize()

  • public void focusGained(com.sun.lwuit.Component)

  • public void focusLost(com.sun.lwuit.Component)

  • protected void focusTextEditor()

  • public java.lang.String getClearText()

  • public boolean getTextEditorEnabled()

  • public com.nokia.lwuit.TextEditorProvider getTextEditorProvider()

  • public int getVisibleContentPosition()

  • protected void hideTextEditor()

  • public void inputAction(com.nokia.lwuit.TextEditorProvider, int)

  • public boolean isNativeTextEditorVisible()

  • public boolean isTextEditorActive()

  • public void pointerDragged(int, int)

  • public void pointerPressed(int, int)

  • public void setClearText(java.lang.String)

  • public void setFocus(boolean)

  • public void setHeight(int)

  • public void setSize(com.sun.lwuit.geom.Dimension)

  • public void setTextEditorEnabled(boolean)

  • public void setVisible(boolean)

  • public void setX(int)

  • public void setY(int)

  • protected void updateNativeComponentPosition()

  • public void updateTextAreaStyles()

com.sun.lwuit.TextField

  • public void inputAction(com.nokia.lwuit.TextEditorProvider, int)

  • method 'public void setClearText(java.lang.String)' is now implemented in superclass com.sun.lwuit.TextArea

com.sun.lwuit.plaf.UIManager

  • public void loadLocalization()

  • public void loadThemeForDeviceType(java.lang.String, int, java.lang.String)

  • public void setNativeDisplay(javax.microedition.lcdui.Display)

APIs using a Series 40 backend implementation

Note that in LWUIT for Series 40 port, some of the original LWUIT classes of the com.sun.lwuit package use Nokia proprietary APIs internally. That is, the implementations of some LWUIT UI components take advantage of the Nokia APIs when possible, but fall back to pure LWUIT solution if the APIs are not available. Examples of such classes are TextArea and TextField which use the TextEditor from Nokia UI package. This affects also the virtual keyboard that is displayed on context of TextArea and TextField.

The API compatibility is maintained and thus it should not affect porting between the original LWUIT and LWUIT for Series 40 . Note, however, that the experience of running the application using LWUIT for Series 40 may differ from original LWUIT application in these cases.