Interface TextFilter
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface TextFilter

public interface netscape.application.TextFilter
{
    /* Methods
     */
    public abstract boolean acceptsEvent(Object, KeyEvent, Vector);
}
Interface implemented by objects interested in filtering key events receiver by "text objects" (TextField and TextView). A text object calls its filter's acceptsEvent() method upon receiving a key event but before processing it. A TextFilter can leave the event unfiltered, or replace it with whatever key event sequences it deems appropriate.
See Also:
setFilter, setFilter

Methods

acceptsEvent

  public abstract boolean acceptsEvent(Object textObject,
                                       KeyEvent event,
                                       Vector events)
Called by textObject upon receiving a KeyEvent. event is the KeyEvent and events is the text object's key event Vector, the Vector it uses to collect KeyEvents. Returning true instructs the text object to place the KeyEvent in the event vector (no filtering) and process it. A TextFilter that wants to filter the key event should return false and add the replacement KeyEvent(s) to events. Access to the text object's event vector allows a TextFilter to turn a single KeyEvent into several. For example, a TextFilter can turn the "t" key into "the" by creating events for "h" and "e," adding all three events to events and returning false.

All Packages  Class Hierarchy  This Package  Previous  Next  Index