Java Reference
In-Depth Information
So far, so good—this is all pretty straightforward. As a matter of fact, the default implementa-
tion provided in CustomItem means you don't even have to think about traversal in many cases.
What makes things a little wonky is the concept of internal traversal. Some items support
traversal of multiple choices inside the item. A good example is the ChoiceGroup item. The following
sequence shows traversal through a form with three items in the MIDP reference implementation
emulator. Figure 7-3 shows the traversal progressing from the text field through the gauge and
into the ChoiceGroup .
(a)
(b)
(c)
(d)
Figure 7-3. Form traversal and internal item traversal
Two methods signal traversal events. The first, traverse() , is called the first time the user
traverses into the item. By default this method returns false , indicating that the item does not
support internal traversal. The second method, traverseOut() , is called whenever the user
leaves the item.
Search WWH ::




Custom Search