Path: blob/master/src/java.desktop/share/classes/javax/swing/DropMode.java
41153 views
/*1* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package javax.swing;2526/**27* Drop modes, used to determine the method by which a component28* tracks and indicates a drop location during drag and drop.29*30* @author Shannon Hickey31* @see JTable#setDropMode32* @see JList#setDropMode33* @see JTree#setDropMode34* @see javax.swing.text.JTextComponent#setDropMode35* @since 1.636*/37public enum DropMode {3839/**40* A component's own internal selection mechanism (or caret for text41* components) should be used to track the drop location.42*/43USE_SELECTION,4445/**46* The drop location should be tracked in terms of the index of47* existing items. Useful for dropping on items in tables, lists,48* and trees.49*/50ON,5152/**53* The drop location should be tracked in terms of the position54* where new data should be inserted. For components that manage55* a list of items (list and tree for example), the drop location56* should indicate the index where new data should be inserted.57* For text components the location should represent a position58* between characters. For components that manage tabular data59* (table for example), the drop location should indicate60* where to insert new rows, columns, or both, to accommodate61* the dropped data.62*/63INSERT,6465/**66* The drop location should be tracked in terms of the row index67* where new rows should be inserted to accommodate the dropped68* data. This is useful for components that manage tabular data.69*/70INSERT_ROWS,7172/**73* The drop location should be tracked in terms of the column index74* where new columns should be inserted to accommodate the dropped75* data. This is useful for components that manage tabular data.76*/77INSERT_COLS,7879/**80* This mode is a combination of <code>ON</code>81* and <code>INSERT</code>, specifying that data can be82* dropped on existing items, or in insert locations83* as specified by <code>INSERT</code>.84*/85ON_OR_INSERT,8687/**88* This mode is a combination of <code>ON</code>89* and <code>INSERT_ROWS</code>, specifying that data can be90* dropped on existing items, or as insert rows91* as specified by <code>INSERT_ROWS</code>.92*/93ON_OR_INSERT_ROWS,9495/**96* This mode is a combination of <code>ON</code>97* and <code>INSERT_COLS</code>, specifying that data can be98* dropped on existing items, or as insert columns99* as specified by <code>INSERT_COLS</code>.100*/101ON_OR_INSERT_COLS102}103104105