An IdleItem is a UI element which supports MIDlet access to the ‘idle screen’ associated with a Display on a device.
2. Display Support
A Display may not support the use of IdleItems. This can be determined by calling the
The UI functionality available via IdleItem is equivalent to that of a CustomItem since the
IdleItem is a sub-class of the
IdleItem class is abstract and must be sub-classed to be used.
4. Getting IdleItem Related UI Characteristics
The foreground, background and highlighted foreground and background colours on an idle screen associated with a given Display can be obtained by calling that Display’s
public int getColor(int colorSpecifier)
method, passing one of the following Display constants
The Fonts for text and highlighted text on an idle screen can be obtained by calling the Font method
public static Font getFont(int fontSpecifier)
passing the constant
5. Getting The Current IdleItem On A Given Display
A MIDlet can get the IdleItem, if any, currently associated with a given Display by calling that
public IdleItem getIdleItem()
6. Setting The Current IdleItem On A Given Display
A MIDlet can request that an IdleItem should appear on the idle screen associated with a given
Display by calling that Display’s
public void setIdleItem(IdleItem idleItem)
If there is an existing associated IdleItem it is removed.
idleItem argument may be
It is an error if the Display does not support IdleItems and a DisplayCapabilityException will be thrown.
It is an error if the specified IdleItem is currently associated with another Display and an IllegalStateException.
The method documentation actually says that an IllegalStateException will be thrown if
If the item is already owned by a Form or Display.
which seems to indicate that it should be possible to add an IdleItem to a Form and that an IdleItem cannot both be a member of a Form and associated with a Display. Presumably the converse also applies.
7. Notification Methods
If after being passed to the
Display.setIdleItem(IdleItem) method of a Display
it is added to the idle screen assciated with that Display, then the IdleItem’s
protected void addedToDisplay(Display display)
method will be called.
If having been added it is subsequently removed from idle screen associated with the
Display then the IdleItem’s
protected void removedFromDisplay(Display display)
method will be called.
Copyright (c) 2009 By Simon Lewis. All Rights Reserved.