KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > grid > ed > ComboSelectionManager


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.grid.ed;
15
16 import javax.swing.*;
17
18 import org.compiere.util.*;
19
20 /**
21  * ComboBox Selection Manager for AuroReduction
22  *
23  * @author Jorg Janke
24  * @version $Id: ComboSelectionManager.java,v 1.2 2002/01/14 06:51:27 jjanke Exp $
25  */

26 public class ComboSelectionManager implements JComboBox.KeySelectionManager
27 {
28     /**
29      *
30      */

31     public ComboSelectionManager()
32     {
33     } // ComboSelectionManager
34

35     /**
36      * Given <code>aKey</code> and the model, returns the row
37      * that should become selected. Return -1 if no match was
38      * found.
39      *
40      * @param key a char value, usually indicating a keyboard key that was pressed
41      * @param model a ComboBoxModel -- the component's data model, containing the list of selectable items
42      * @return an int equal to the selected row, where 0 is the first item and -1 is none
43      */

44     public int selectionForKey (char key, ComboBoxModel model)
45     {
46         Log.trace(Log.l6_Database, "ComboSelectionManager.selectionForKey",
47             "Key=" + key);
48         //
49
int currentSelection = -1;
50         Object JavaDoc selectedItem = model.getSelectedItem();
51
52
53         return 0;
54     } // selectionForKey
55

56
57 } // ComboSelectionManager
58
Popular Tags