home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 2.8 KB | 94 lines |
- /*
- * @(#)TextEvent.java 1.7 98/03/18
- *
- * Copyright 1996, 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt.event;
-
- import java.awt.AWTEvent;
- import java.awt.Event;
-
- /**
- * A semantic event which indicates that an object's text changed.
- * This high-level event is generated by an object (such as a TextComponent)
- * when its text changes. The event is passed to
- * every <code>TextListener</code> object which registered to receive such
- * events using the component's <code>addTextListener</code> method.
- * <P>
- * The object that implements the <code>TextListener</code> interface gets
- * this <code>TextEvent</code> when the event occurs. The listener is
- * spared the details of processing individual mouse movements and key strokes
- * Instead, it can process a "meaningful" (semantic) event like "text changed".
- *
- * @see java.awt.TextComponent
- * @see TextListener
- * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/textlistener.html">Tutorial: Writing a Text Listener</a>
- * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
- *
- * @version 1.7 03/18/98
- * @author Georges Saab
- */
-
- public class TextEvent extends AWTEvent {
-
- /**
- * The first number in the range of ids used for text events.
- */
- public static final int TEXT_FIRST = 900;
-
- /**
- * The last number in the range of ids used for text events.
- */
- public static final int TEXT_LAST = 900;
-
- /**
- * This event id indicates that object's text changed.
- */
- public static final int TEXT_VALUE_CHANGED = TEXT_FIRST;
-
- /*
- * JDK 1.1 serialVersionUID
- */
- private static final long serialVersionUID = 6269902291250941179L;
-
- /**
- * Constructs a TextEvent object.
- *
- * @param source the (TextComponent) object that originated the event
- * @param id an integer that identifies the event type
- */
- public TextEvent(Object source, int id) {
- super(source, id);
- }
-
-
- /**
- * Returns a parameter string identifying this text event.
- * This method is useful for event-logging and for debugging.
- *
- * @return a string identifying the event and its attributes
- */
- public String paramString() {
- String typeStr;
- switch(id) {
- case TEXT_VALUE_CHANGED:
- typeStr = "TEXT_VALUE_CHANGED";
- break;
- default:
- typeStr = "unknown type";
- }
- return typeStr;
- }
- }
-
-
-