1 /* 2 * @(#)DropMode.java 1.2 05/11/17 3 * 4 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 package javax.swing; 8 9 /** 10 * Drop modes, used to determine the method by which a component 11 * tracks and indicates a drop location during drag and drop. 12 * 13 * @author Shannon Hickey 14 * @version 1.2 11/17/05 15 * @see JTable#setDropMode 16 * @see JList#setDropMode 17 * @see JTree#setDropMode 18 * @see javax.swing.text.JTextComponent#setDropMode 19 * @since 1.6 20 */ 21 public enum DropMode { 22 23 /** 24 * A component's own internal selection mechanism (or caret for text 25 * components) should be used to track the drop location. 26 */ 27 USE_SELECTION, 28 29 /** 30 * The drop location should be tracked in terms of the index of 31 * existing items. Useful for dropping on items in tables, lists, 32 * and trees. 33 */ 34 ON, 35 36 /** 37 * The drop location should be tracked in terms of the position 38 * where new data should be inserted. For components that manage 39 * a list of items (list and tree for example), the drop location 40 * should indicate the index where new data should be inserted. 41 * For text components the location should represent a position 42 * between characters. For components that manage tabular data 43 * (table for example), the drop location should indicate 44 * where to insert new rows, columns, or both, to accommodate 45 * the dropped data. 46 */ 47 INSERT, 48 49 /** 50 * The drop location should be tracked in terms of the row index 51 * where new rows should be inserted to accommodate the dropped 52 * data. This is useful for components that manage tabular data. 53 */ 54 INSERT_ROWS, 55 56 /** 57 * The drop location should be tracked in terms of the column index 58 * where new columns should be inserted to accommodate the dropped 59 * data. This is useful for components that manage tabular data. 60 */ 61 INSERT_COLS, 62 63 /** 64 * This mode is a combination of <code>ON</code> 65 * and <code>INSERT</code>, specifying that data can be 66 * dropped on existing items, or in insert locations 67 * as specified by <code>INSERT</code>. 68 */ 69 ON_OR_INSERT, 70 71 /** 72 * This mode is a combination of <code>ON</code> 73 * and <code>INSERT_ROWS</code>, specifying that data can be 74 * dropped on existing items, or as insert rows 75 * as specified by <code>INSERT_ROWS</code>. 76 */ 77 ON_OR_INSERT_ROWS, 78 79 /** 80 * This mode is a combination of <code>ON</code> 81 * and <code>INSERT_COLS</code>, specifying that data can be 82 * dropped on existing items, or as insert columns 83 * as specified by <code>INSERT_COLS</code>. 84 */ 85 ON_OR_INSERT_COLS 86 } 87