0N/A/*
2362N/A * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.awt.event;
0N/A
0N/Aimport java.awt.AWTEvent;
0N/A
0N/A/**
0N/A * A semantic event which indicates that an object's text changed.
0N/A * This high-level event is generated by an object (such as a TextComponent)
0N/A * when its text changes. The event is passed to
0N/A * every <code>TextListener</code> object which registered to receive such
0N/A * events using the component's <code>addTextListener</code> method.
0N/A * <P>
0N/A * The object that implements the <code>TextListener</code> interface gets
0N/A * this <code>TextEvent</code> when the event occurs. The listener is
0N/A * spared the details of processing individual mouse movements and key strokes
0N/A * Instead, it can process a "meaningful" (semantic) event like "text changed".
217N/A * <p>
217N/A * An unspecified behavior will be caused if the {@code id} parameter
217N/A * of any particular {@code TextEvent} instance is not
217N/A * in the range from {@code TEXT_FIRST} to {@code TEXT_LAST}.
0N/A *
0N/A * @author Georges Saab
0N/A *
0N/A * @see java.awt.TextComponent
0N/A * @see TextListener
0N/A *
0N/A * @since 1.1
0N/A */
0N/A
0N/Apublic class TextEvent extends AWTEvent {
0N/A
0N/A /**
0N/A * The first number in the range of ids used for text events.
0N/A */
0N/A public static final int TEXT_FIRST = 900;
0N/A
0N/A /**
0N/A * The last number in the range of ids used for text events.
0N/A */
0N/A public static final int TEXT_LAST = 900;
0N/A
0N/A /**
0N/A * This event id indicates that object's text changed.
0N/A */
0N/A public static final int TEXT_VALUE_CHANGED = TEXT_FIRST;
0N/A
0N/A /*
0N/A * JDK 1.1 serialVersionUID
0N/A */
0N/A private static final long serialVersionUID = 6269902291250941179L;
0N/A
0N/A /**
0N/A * Constructs a <code>TextEvent</code> object.
217N/A * <p> This method throws an
0N/A * <code>IllegalArgumentException</code> if <code>source</code>
0N/A * is <code>null</code>.
0N/A *
217N/A * @param source The (<code>TextComponent</code>) object that
0N/A * originated the event
217N/A * @param id An integer that identifies the event type.
217N/A * For information on allowable values, see
217N/A * the class description for {@link TextEvent}
0N/A * @throws IllegalArgumentException if <code>source</code> is null
217N/A * @see #getSource()
217N/A * @see #getID()
0N/A */
0N/A public TextEvent(Object source, int id) {
0N/A super(source, id);
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Returns a parameter string identifying this text event.
0N/A * This method is useful for event-logging and for debugging.
0N/A *
0N/A * @return a string identifying the event and its attributes
0N/A */
0N/A public String paramString() {
0N/A String typeStr;
0N/A switch(id) {
0N/A case TEXT_VALUE_CHANGED:
0N/A typeStr = "TEXT_VALUE_CHANGED";
0N/A break;
0N/A default:
0N/A typeStr = "unknown type";
0N/A }
0N/A return typeStr;
0N/A }
0N/A}