Class AwtUIMenuList
public class AwtUIMenuList extends AwtUIControl implements
IAwtUIItemSelectable
{
// Constructors
public AwtUIMenuList();
public AwtUIMenuList(int layoutStyle);
// Methods
public void addActionListener(ActionListener l);
public void addItemListener(ItemListener l);
public IUIComponent getBase();
protected void processActionEvent(ActionEvent e);
protected void processHostEvent(AWTEvent e);
protected void processItemEvent(ItemEvent e);
public synchronized void removeActionListener(ActionListener l);
public synchronized void removeItemListener(ItemListener l);
}
This class implements the functionality of a UIMenuList object in an AWT-based control. An AwtUIMenuList control is an AwtUIHost component whose associated root container holds a UIMenuList object. By hosting this object, an AwtUIMenuList control integrates AFC with AWT. Although an AwtUIMenuList control is fully compatible with AWT, a UIMenuList control is optimized for performance and size.
Panel
|
+--AwtUIHost
|
+--AwtUIControl
|
+--AwtUIMenuList
public AwtUIMenuList();
Creates an empty AWT-based menu list control.
Remarks:
Call the add method (inherited through AwtUIControl) to add items to the list. By default, the control's selection mode is SINGLESELECT, and the layout style is FILL.
public AwtUIMenuList(int layoutStyle);
Creates an empty AWT-based menu list control with the specified layout style.
Parameter | Description |
layoutStyle
| The layout style of the control. Possible values include UIVerticalFlowLayout.MULTICOLUMN, UIVerticalFlowLayout.FILL, or a bitwise combination of the two. (FILL extends the width of an item to the width of the list control; this allows the item to be selected even when the area outside of its text label is clicked.) Specify 0 for a single-column list with no fill.
|
Remarks:
Call the add method (inherited through AwtUIControl) to add items to the list. By default, the control's selection mode is SINGLESELECT.
Exceptions:
IllegalArgumentException
if an undefined layout style was specified.
public void addActionListener(ActionListener l);
Adds the specified action listener. The listener receives all action events generated for the control.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be added.
|
See Also: removeActionListener
public void addItemListener(ItemListener l);
Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be added.
|
See Also: removeItemListener
public IUIComponent getBase();
Retrieves the UI component that the control is based on.
Return Value:
Returns the UIMenuList object associated with the control.
Remarks:
When the AWT-based control is first created, it is associated with a UIMenuList object.
protected void processActionEvent(ActionEvent e);
Processes action events.
Return Value:
No return value.
Parameter | Description |
e
| The action event.
|
Remarks:
This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.
See Also: addActionListener
protected void processHostEvent(AWTEvent e);
Processes the specified event.
Return Value:
No return value.
Parameter | Description |
e
| The event.
|
Remarks:
This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the following methods.
When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.
protected void processItemEvent(ItemEvent e);
Processes item events.
Return Value:
No return value.
Parameter | Description |
e
| The item event.
|
Remarks:
This method is called by processHostEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.
See Also: addItemListener
public synchronized void removeActionListener(ActionListener l);
Removes the specified action listener. The listener no longer receives the control's action events.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be removed.
|
See Also: addActionListener
public synchronized void removeItemListener(ItemListener l);
Removes the specified item listener. The listener no longer receives the control's item events.
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be removed.
|
See Also: addItemListener