KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > swing > CFieldEditor


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.swing;
15
16 import java.awt.Component JavaDoc;
17
18 import javax.swing.ComboBoxEditor JavaDoc;
19 import javax.swing.JTextField JavaDoc;
20
21 /**
22  * Compiere Field Editor.
23  *
24  *
25  * @author Jorg Janke
26  * @version $Id: CFieldEditor.java,v 1.3 2003/09/27 11:08:51 jjanke Exp $
27  */

28 public class CFieldEditor extends JTextField JavaDoc implements ComboBoxEditor JavaDoc
29 {
30     /**
31      *
32      */

33     public CFieldEditor()
34     {
35     }
36
37     /**
38      * Return the component that should be added to the tree hierarchy
39      * for this editor
40      */

41     public Component JavaDoc getEditorComponent()
42     {
43         return this;
44     } // getEditorCimponent
45

46     /**
47      * Set Editor
48      * @param anObject
49      */

50     public void setItem (Object JavaDoc anObject)
51     {
52         if (anObject == null)
53             setText("");
54         else
55             setText(anObject.toString());
56     } // setItem
57

58     /**
59      * Get edited item
60      * @return edited text
61      */

62     public Object JavaDoc getItem()
63     {
64         return getText();
65     } // getItem
66

67     /**
68      * Returns format Info (for Popup)
69      * @return format
70      */

71     public Object JavaDoc getFormat()
72     {
73         return null;
74     } // getFormat
75

76 } // CFieldEditor
77
Popular Tags