ItemEvent to UIItemEvent

To convert from AWT to AFC, instances of java.awt.event.ItemEvent should be transformed into instances of com.ms.ui.event.UIItemEvent.

ItemEvent extends AWTEvent: be sure to see its changes.

Purpose and Usage

AFC provides an adapter class, UIItemAdapter, for this event.

Porting

This is the set of changes you need to make to port all ItemEvent methods to UIItemEvent methods. Any method not listed here or below does not need to be changed.

 

AWT Code AFC Code Comments
ItemEvent(ItemSelectable, int, Object, int) ItemEvent(IUIComponent, int, Object, int) The source is always an IUIComponent.

 

Unsupported Methods and Constants

Some methods and constants in java.awt.event.ItemEvent are not directly supported in com.ms.ui.event.UIItemEvent. Those methods and constants, and suggested workarounds, are described here.

 

AWT Code/Suggested AFC Code Comments
ITEM_FIRST

(no suggestions)

 
ITEM_LAST

(no suggestions)

 
getItemSelectable()

getItemSelectable()

The AWT version returns an ItemSelectable: the AFC version returns an IUIComponent.