Table of Contents
The Lighweight UI Toolkit version 1.4 provides the following new or changed features:
- XHTML Support - LWUIT Now features the ability to render XHTML-MP 1.0 content and partial support
- LWUIT Browser demo application - new demo application showing the usage of the HTML component.
- Timeline animations - New animation type leveraging the LWUIT EncodedImage
- Multiline Text Field - In place text field editing using a multiline
- Blackberry-specific Binaries - This release features JAR's for native Blackberry application support
- Virtual Keyboard enhancements
The new HTML package enables rendering HTML documents that conform to the XHTML Mobile Profile 1.0 standard.
The main class is HTMLComponent which is a container that builds the HTML inside it.
It is constructed with an implementation of the DocumentRequestHandler - which handles all necessary communications/IO to get the document.
Another public interface is HTMLCallback that allows getting events from the HTMLComponent.
The use of the package is demonstarted in the LWUITBrowser project, where you can find a concrete implementation for DocumentRequestHandler.
This version supports most of the tags in XHTML-MP 1.0, see the class Element for tags that are not
supported (documented to the side of the TAG_* constant).
The package includes an internal Parser and a DOM object (Element) and more.
LWUIT HTML Package
- Text Rendering
- Added support for non-fixed-width mode. Up till now HTMLComponent worked on a fixed width (the display width) and did its own text wrapping. Now it supports dynamic width. The downside here is that in this mode text is broken to one-label per word (more components, more resources used), also this mode still has some problems with text alignments and RTL languages. Choosing the mode can be done with the FIXED_WIDTH constant in HTMLComponent.
- Text justification has been added (align=justify). This is supported only in fixed width mode and only for the P and DIV tags (Not supported for tables)
- The START and TYPE attributes in the OL tag are now implemented (allowing choosing a start value for a list and list numbering type)
- The TYPE and VALUE atttributes in the LI tag are now implemented (allowing changing the value or type of a single item in a list)
- Note: while these list attributes are deprecated (and should be used with CSS) they are still supported in most major browsers, so they were added.
- Combo Boxes:
- The OPTGROUP tag is now implemented, allowing defining headers within fields
- The MULTIPLE attribute in the SELECT tag is now implemented, allowing multiple selection ComboBoxes
- The MultiComboBox class was added. it includes MultiListCellRenderer and MultiListModel. These classes enable multiple selection ComboBox and OPTGROUP labels support.
- The HTMLComboBox class was added - it allows supporting OPTGROUP also within single-selection ComboBox by using MultiComboBox as its popup list
- The SIZE attribute in the SELECT tag is now supported (defines the number of visible rows in multiple selection combo boxes)
- DefaultHTMLCallback, a simple implementation of HTMLCallback was added to provide an easy way to override only needed method, and to demonstrate the default implementation for all methods.
- Added getLinkProperties method in HTMLCallback allowing support for Visited links and Forbidden links (i.e. links the component shouldn't render as selectable)
- Added linkClicked method in HTMLCallback allowing external handling of various links (useful to make other operations the HTML displaying, for example triggering logic in the app itself)
- AutoComplete is now supported for TextAreas as well (used to be only for TextField)
- pageStatusChanged is now called in all cases from the EDT thread. Also added documentation to HTMLCallback to specify which methods are called on EDT and which are not.
- Additional attributes/tags support:
- Added support for the BASE tag HREF attribute
- Added support for the ENCTYPE attribute in the FORM tag
- Added support for the BGCOLOR,LINK and TEXT attributes in the BODY tag - these allow control for basic colors within the HTML - while these attributes are deprecated (and should be used with CSS), they are still supported in most major browsers, so they were added.
- Added the HTMLInputFormat class which enables support of the (deprecated but generally supported) FORMAT atttribute in the INPUT tag. It allows defining the allowed pattern for input fields (i.e. only numeric/uppercase/lowercase/symbols and any combination thereof with an indication of the number of chars from each category). The class verifies that input is according to the pattern, alerts if it's not (and blocks form submission) and applies appropriate constraints to the TextFields if applicable. Since the code used to support this feature is rather big, it can be obfuscated out by toggling the SUPPORT_INPUT_FORMAT constant in HTMLComponent
- Accesskeys (i.e. the ACCESSKEY attribute) is now supported not only for links, but also for input fields (INPUT tag) and for-labels (LABEL tag).
WCSS Support for HTMLComponent
The support is almost complete and includes most mandatory properties and values and even some optional ones.
Fully supported CSS properties:
- Background: background-color, background-image, background-repeat, background-attachment, background-position-x, background-position-y
- Border: border-*-width, border-*-style, border-*-color
- Fonts: font-family, font-size, font-style, font-weight, font-variant
- Lists: list-style-image, list-style-position, list-style-type
- Margins: margin-* , padding-*
- Text: text-align, text-indent, text-transform
- Misc: color, height, width, visibilityv
- WAP : -wap-access-key,-wap-input-format,-wap-input-required
- Shorthand properties: All shorthand properties are fully supported
(* = top/left/bottom/right)
Partially supported properties:
- display - Supported values: none, marquee. Unsupported values: block, inline , list-item
- white-space - Supported values: normal, nowrap. Unsupported: pre
- vertical-align - Works only within tables
Changes in this Release
- width/height work for simple elements, but may be problematic with complex elements.
- font-family accepts the first mentioned font and ignores all fallback fonts, since finding a matching font is very time consuming, and also since in the ME environment usually there aren't that many fonts anyway.
- text-decoration is unrelevant: since the only mandatory WCSS decoration value is 'none' which is usually used to remove underlines from links - since we don't have underlines it has no meaning
- text-transform may have issues when overriding a parent which has a different transform
- HTMLComponent.FIXED_WIDTH mode does not work with some CSS attributes, and thus its default value is now false. The downside is that in FIXED_WIDTH mode 'justify' alignment doesn't work.
The full WCSS spec can be found at: http://www.wapforum.org/tech/documents/WAP-239-WCSS-20011026-a.pdf. Properties or values that are defined as optional may not be supported, for example, some border types.
Changes in this Release
This section lists all changes in this release.
- A small fix for TextArea that prevents redundant text wrapping calculations when the TextArea still has no size, i.e. wasn't placed in a displayed form (can be very significant in long texts)
- Added a factory method to create a native image, thus allowing better integration with native API's that return image objects.
- Added a protected method allowing the motion class to be created on the fly
- Added a type none to the dialogs
- Added an ability to disable the tensile drag behavior if so desired
- Added an API that allows a developer to bind a VirtualKeyboard instance to a specific TextField instance
- Added context based virtualkeyboards.
- Added default values for the tensile drag and ends with 3 points flags
- Added examples of using setBodyText and setHTML as commented code
- Added hint text to TextField and TextArea
- Added LWUIT HTML rendering Package
- Added multi line TextField feature.
- Added null checks for a case that the document was set by setBodyText
- Added setHTML that enables setting a full HTML string (i.e. not just body) as the HTML of the HTMLComponent
- Added support for "pure touch" mode, this disables focus rendering when the user uses the touch screen only and renders focus only when the GUI is touched. This is the user experience found in Android and the iPhone touch devices.
- Added support for getting the selected row/column in a table: http://forums.java.net/jive/thread.jspa?messageID=387360
- Added the ability to "no_sleep" in the Display class
- Added the ability to add place holders in the virtualkeyboard and exposed actions ID's of the virtualkeyboard
- Added the ability to determine focus based scrolling on a form by form basis
- Added the ability to turn on/off CSS
- Added the LWUITBrowser demo application
- Added the new LWUIT animation framework for simpler more robust animations, these are mostly designed for use with the upcoming resource editor that will include more support for such objects.
- Added the possibility to define the style of the page by using setPageStyle (useful for example to make it transparent). Also minor documentation and code changes
- Added WCSS support for HTMLComponent. The support is almost full and includes most mandatory properties and values and even some optional ones.
- Allowing bgPainters to animate. Also added the ability for motion to start "late" this is a prelude for the new LWUIT animation code.
- Also fixed parsing issues when the Parser bumps into a closing tag of an unopened tag (used to stop processing of the current parent tag, now it continues).
- Animation object fix for race conditions that may occur in the resource editor.
- Animation queue might be null for some unclear use cases
- Attempted fix for issue 296: Gap is not taken into account properly in CENTER align
- Better memory management when a transition is failed
- Enabled table cells spanning in HTML
- Exposed a protected constructor for image, allowing subclasses from outside of the package which is useful for timeline but also might be useful for future community ideas.
- Firing change events from the style on painter change
- Fix for an exception when using a table without headers
- Fix for an issue in the Nokia keyboard detection code that isn't exactly intuitive: http://forums.java.net/jive/thread.jspa?messageID=453819
- Fix for issue 252: Ability to use the old focus-based scrolling approach in LWUIT
- Fix for issue 255: TextArea wrapping in Arabic dosn't count the shaping effect. This is a regression due to a performance improvement I made. It is now possible to fix this using TextArea.setUseStringWidth(true)
- Fix for issue 257: BlackBerry Port uses Hidden APIs. Inadvertently used undocumented method/fields in the Blackberry port. This essentially means that the Blackberry no longer supports control over anti-aliasing
- Fix for issue 262: ButtonGroup Selection fires repaint multiple times
- Fix for issue 264: ComboBox- no way to remove "select-cancel" dialog A flag for this is now in place
- Fix for issue 267: Spinner sometimes displays long numbers instead of rounded. Rounding the numbers in a new renderer for 2 digits
- Fix for issue 274: MIDlet that uses LWUIT framework, consumes too much battery when running in SonyEricsson Symbian platform. This is unrelated to the platform. The animation didn't deregister itself properly on completion of scrolling.
- Fix for issue 275: DefaultTableModel.setValueAt does not work when executed from a command which is part of a menu.
- Fix for issue 281: Ability to turn off the tooltips in the VirtualKeyboard
- Fix for issue 285: Cancel command of symbols dialog should be localizable
- Fix for issue 300: DefaultLookAndFeel has a small issue in getTextAreaSize()
- Fix for issue 301: paintBorderBackground() in Border.java has a small bug
- Fix for max size in the text field
- Fix for null pointer regression in tables triggered by the html component
- Fix for potential bug in Display.getCurrent() discussed here: http://forums.java.net/jive/thread.jspa?messageID=398050
- Fix for RFE 235: Improve the flexibility of Motion class for existing transitions
- Fix for RFE 282: Time Spinner AM/PM denomination
- Fix for RFE 304: In and out transition animation for VKeyboard
- Fix for scaling cache that didn't work correctly resulting in memory overhead for the UI demo. Especially noticeable in the UI Demo's new theme.
- Fix for scrolling based on focus feature discussed here: http://forums.java.net/jive/thread.jspa?messageID=390124#390124
- Fix for scrolling on both axses
- Fix for table cell rendering issues
- Fix for table preventing cells from becoming focusable by force (hence allowing for none-focusable table cells).
- Fix for tactile touch on Samsung devices causing a lockup of the device due to a device bug with vibration
- Fix for touch menu size which was incorrect practically always.
- Fix so tabbed pane hasFocus would behave more logically
- Fixed a bug (issue 279) that when bumping into an unsupported empty tag (i.e. <tagname />). The Parser used to skip the entire document from that point forward. Now it just ignores it.
- Fixed a bug in isMinimized() reported by the forum.
- Fixed a bug that caused the component to report a size smaller in one line
- Fixed a bug that occured when loading big images (bug in HttpRequestHandler.getBuffer)
- Fixed a clipping bug (thanks Biswajit)
- Fixed a couple of VirtualKeyboard related issue and a minor combobox painting issue related issue and a minor combobox painting issue
- Fixed a current mode bug in virtual keyboard
- Fixed a minor behavior - pointer pressed on a Component needs to stop parent Container dragging
- Fixed a minor glitch in TextField that affected the VirtualKeyboard's first letter inserted
- Fixed a minor issue in doLayout (contributed by Telmap)
- Fixed a minor memory leak in EventDispatcher
- Fixed a minor position bug in FlowLayout
- Fixed a regression in FlowLayout (bug #307)
- Fixed an addSpecialButton bug in virtual keyboard and an old flowlayout bug (some components weren't visible when out of screen)
- Fixed an Exception in VirtualKeyboard
- Fixed an issue that when using setBody the HTMLComponent would throw NullPointerException since docInfo was null. Checks were added to the component in relevant places to handle that case.
- Fixed an issue with scrollRectToVisible
- Fixed an issue with the virtual keyboard and table where the deinitialize of table was invoked when the VKB was shown thus removing the listener and model update of a text field.
- Fixed an old bug in BorderLayout bottom margin
- Fixed an old bug in FlowLayout - preferred size didn't take parent width into consideration and a minor change in Display class
- Fixed BG color defined in body tag
- Fixed cases in which resources (CSS files, Images) that are referenced with a relative URL in a document that has no base URL (since it was set via setHTML/setBody). Added the ERROR_NO_BASE_URL for such cases.
- Fixed cases in which using white-space nowrap/wrap that changed the element UI vector caused a NPE (issue 306)
- Fixed focusScrolling to move the scroll, when enabled
- Fixed HTML links coloring. Link colors are now affected - but only if there 's a direct selector for their element
- Fixed image to detect natively animated images
- Fixed issue of slow rendering of tables, especially nested ones. The downside is that the size is fixed according to what each cell requests, and that all images should be loaded before the page is displayed. This can be toggled on and off with the TABLES_SIZE_LOCK flag in HTMLComponent
- Fixed max size in VirtualKeyboard
- Fixed parsing issues with unrecognized empty tags that have attributes
- Fixed row/column spanning in the table component
- Fixed some bugs in HTMLComponent including color parsing bugs and NullPointerException when loading images and not having an HTMLCallback.
- Fixed tabbed pane scrolling issue with touch devices 239, this was fixed by enabling smooth scrolling and repainting when it took effect.
- Fixed TextField to be single line TextField by default when the input is password
- Fixed VirtualKeyboard bug when modes were replaced the screen flickered
- Fixed VirtualKeyboard t9 editing to work properly on Nokia as well
- Fixing height calculation bug in FlowLayout (this has a major effect on HTMLComponent)
- Hopefully the last spanning border related fix
- Implemented RFE 286: ComboBox references all UIID's used in their full name, making it very hard to change the base name. All internal names are now derivative of the combo box UIID.
- Improved moveScrollTowards logic (see http://forums.java.net/jive/thread.jspa?messageID=470747)
- Improved the layout behavior of the Table/TableLayout so it would distribute available space evenly when too much space is requested by the various components within the table.
- Improved the UIID of the dialog
- Increased the VKB spacing for devices such as the F480 where the bottom portion of the screen is not very responsive.
- Made isDragActivated() protected based on requests from the form, the use case is for overriding pointerRelease in TextArea where it might not be clear if the operation is an activation or a drag.
- Minor fix for Label tickering
- Minor fixes for table layouts with spanning and a general fix for the drawing of spanned border
- Moved the Samsung vibrate crash workaround into the implementation code
- Removed commented out code from table
- Removed wrong size boundaries in flowlayout
- Some fixes to HttpRequestHandler (mainly encoding)
- The back command now appears in menubar only when there's actually a back page in the stack
- The calcPreferredSize for the menu bar class reset the height of the menu bar but didn't take into account the 3rd softbutton mode.
- The TextField on the VirtualKeyboard triggered another VirtualKeyboard dialog
- The VirtualKeyboard TextField unselected style should be equal to the selected style by default
- Theme changes (for CSS's smallcaps)
- Theme changes including new icons for the toolbar
- Turned FIXED_WIDTH mode to false. This should be the default, especially with CSS
- When breaking lines the flow layout zeroed out the width variable in the preferred size. This doesn't make sense since the width should still be as wide as the first line at least...
- Workaround for a rendering artifact in combination with the VKB in the UI demo.
- Workaround for issue 244 by disabling the select/cancel functionality
- Workaround for issue in E72 which accepts letters as gamekeys