KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > minigrid > IDColumn


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.minigrid;
15
16 /**
17  * ID Column for MiniGrid allows to select a column and maintains the record ID
18  *
19  * @author Jorg Janke
20  * @version $Id: IDColumn.java,v 1.5 2002/08/12 01:55:14 danb Exp $
21  */

22 public class IDColumn
23 {
24     /**
25      * ID Column constructor
26      * @param record_ID
27      */

28     public IDColumn (int record_ID)
29     {
30         this(new Integer JavaDoc(record_ID));
31     } // IDColumn
32

33     /**
34      * ID Column constructor
35      * @param record_ID
36      */

37     public IDColumn(Integer JavaDoc record_ID)
38     {
39         super();
40         setRecord_ID(record_ID);
41         setSelected(false);
42     } // IDColumn
43

44     /** Is the row selected */
45     private boolean m_selected = false;
46     /** The Record_ID */
47     private Integer JavaDoc m_record_ID;
48
49
50     /**
51      * Set Selection
52      * @param selected
53      */

54     public void setSelected(boolean selected)
55     {
56         m_selected = selected;
57     }
58     /**
59      * Is Selected
60      * @return true if selected
61      */

62     public boolean isSelected()
63     {
64         return m_selected;
65     }
66
67     /**
68      * Set Record_ID
69      * @param record_ID
70      */

71     public void setRecord_ID(Integer JavaDoc record_ID)
72     {
73         m_record_ID = record_ID;
74     }
75     /**
76      * Get Record ID
77      * @return ID
78      */

79     public Integer JavaDoc getRecord_ID()
80     {
81         return m_record_ID;
82     }
83
84     /**
85      * To String
86      * @return String representation
87      */

88     public String JavaDoc toString()
89     {
90         return "IDColumn - ID=" + m_record_ID + ", Selected=" + m_selected;
91     } // toString
92

93 } // IDColumn
94
Popular Tags