Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class AwtUIRepeatButton

public class AwtUIRepeatButton extends AwtUIButton
{
  // Constructors
  public AwtUIRepeatButton();
  public AwtUIRepeatButton(IUIComponent comp);
  public AwtUIRepeatButton(String text);
  public AwtUIRepeatButton(String text, int style);
  public AwtUIRepeatButton(IUIComponent comp, int style);

  // Methods
  public void addActionListener(ActionListener l);
  public IUIComponent getBase();
  protected void processActionEvent(ActionEvent e);
  protected void processHostEvent(AWTEvent e);
  public synchronized void removeActionListener(ActionListener l);
}

This class implements the functionality of a UIRepeatButton object in an AWT-based control. An AwtUIRepeatButton control is an AwtUIHost component whose associated root container holds a UIRepeatButton object. By hosting this object, an AwtUIRepeatButton control integrates AFC with AWT. Although an AwtUIRepeatButton control is fully compatible with AWT, a UIRepeatButton control is optimized for performance and size.

Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIButton
        |
        +--AwtUIRepeatButton

Constructors

AwtUIRepeatButton

public AwtUIRepeatButton();

Creates an AWT-based repeating push button with no content.

Remarks:

By default, the button has a flat style.

AwtUIRepeatButton

public AwtUIRepeatButton(IUIComponent comp);

Creates an AWT-based repeating push button with the specified component.

ParameterDescription
comp The component to be displayed within the button.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button has a flat style. For examples of how to construct buttons, see the UIButton overview.

AwtUIRepeatButton

public AwtUIRepeatButton(String text);

Creates an AWT-based repeating push button with the specified text.

ParameterDescription
text The text to be displayed within the button.

Remarks:

By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

AwtUIRepeatButton

public AwtUIRepeatButton(String text, int style);

Creates an AWT-based repeating push button with the specified text and style.

ParameterDescription
text The text to be displayed within button.
style The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

AwtUIRepeatButton

public AwtUIRepeatButton(IUIComponent comp, int style);

Creates an AWT-based repeating push button with the specified component and style.

ParameterDescription
comp The component to be displayed within button.
style The style of the button. Possible values include any bitwise combination of UIPushButton.RAISED, UIButton.TOGGLE, and UIButton.TRITOGGLE. (Combining TOGGLE and TRITOGGLE results in TRITOGGLE.) To specify a flat style, pass 0 for this parameter.

Remarks:

Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

addActionListener

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.

ParameterDescription
l The action listener to be added.

See Also: removeActionListener

getBase

public IUIComponent getBase();

Retrieves the UI component that the button is based on.

Return Value:

Returns the UIRepeatButton object associated with the button control.

Remarks:

When the AWT-based button is first created, it is associated with a UIRepeatButton object.

processActionEvent

protected void processActionEvent(ActionEvent e);

Processes action events.

Return Value:

No return value.

ParameterDescription
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

processHostEvent

protected void processHostEvent(AWTEvent e);

Processes the specified event.

Return Value:

No return value.

ParameterDescription
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.

Event type Method called
action event processActionEvent
component event processComponentEvent (inherited through AwtUIHost)
container event processContainerEvent (inherited through AwtUIHost)
focus event processFocusEvent (inherited through AwtUIHost)
key event processKeyEvent (inherited through AwtUIHost)
mouse event processMouseEvent (inherited through AwtUIHost)
mouse motion event processMouseMotionEvent (inherited through AwtUIHost)

When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.

removeActionListener

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.

ParameterDescription
l The action listener to be removed.

See Also: addActionListener

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.