jdk/src/share/classes/sun/awt/FocusingTextField.java
changeset 11289 09f33bb6dfb7
parent 11263 3d8e5c15d5d4
parent 11288 3192d89032b0
child 11292 d0ec48636c58
child 11360 cfa173720adb
child 11495 d92e8e5a71ec
child 11498 d2da29f30ae4
--- a/jdk/src/share/classes/sun/awt/FocusingTextField.java	Thu Dec 22 19:00:41 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.awt;
-
-import java.awt.*;
-
-/**
- * FocusingTextField: a subclass of java.awt.TextField that handles moving the
- * input focus from field to field, as when the user hits 'return.'
- *
- * @author Herb Jellinek
- */
-
-public class FocusingTextField extends TextField {
-
-    /** The field to move to on 'return' - can be null. */
-    TextField next;
-
-    /** If true, select the contents of the field when it gets the focus. */
-    boolean willSelect;
-
-    /**
-     * Create a FocusingTextField.
-     * @param cols number of columns of text.
-     */
-    public FocusingTextField(int cols) {
-        super("", cols);
-    }
-
-    /**
-     * Create a FocusingTextField.
-     * @param cols number of columns of text.
-     * @param willSelect if true, will select all contents of field when
-     * focus is gained.
-     */
-    public FocusingTextField(int cols, boolean willSelect) {
-        this(cols);
-        this.willSelect = willSelect;
-    }
-
-    public void setWillSelect(boolean will) {
-        willSelect = will;
-    }
-
-    public boolean getWillSelect() {
-        return willSelect;
-    }
-
-    /**
-     * Call this to set the next field to receive the input focus.
-     * @param next the next TextField in order - can be null.
-     */
-    public void setNextField(TextField next) {
-        this.next = next;
-    }
-
-    /**
-     * We got the focus.  If willSelect is true, select everything.
-     */
-    public boolean gotFocus(Event e, Object arg) {
-        if (willSelect) {
-            select(0, getText().length());
-        }
-        return true;
-    }
-
-    /**
-     * We lost the focus.  If willSelect is true, deselect everything.
-     */
-    public boolean lostFocus(Event e, Object arg) {
-        if (willSelect) {
-            select(0, 0);
-        }
-        return true;
-    }
-
-    /**
-     * Pass the focus to the next guy, if any.
-     */
-    public void nextFocus() {
-        if (next != null) {
-            next.requestFocus();
-        }
-        super.nextFocus();
-    }
-}