KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > apps > search > Info_Column


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.apps.search;
15
16 /**
17  * Info Column Details
18  *
19  * @author Jorg Janke
20  * @version $Id: Info_Column.java,v 1.2 2001/10/23 03:01:55 jjanke Exp $
21  */

22 public class Info_Column
23 {
24     /**
25      * Create Info Column (r/o and not color column)
26      *
27      * @para colHeader Column Header
28      * @para colSQL SQL select code for column
29      * @para colClass class of column - determines display
30      */

31     public Info_Column (String JavaDoc colHeader, String JavaDoc colSQL, Class JavaDoc colClass)
32     {
33         this(colHeader, colSQL, colClass, true, false, null);
34     } // Info_Column
35

36     /**
37      * Create Info Column (r/o and not color column)
38      *
39      * @para colHeader Column Header
40      * @para colSQL SQL select code for column
41      * @para colClass class of column - determines display
42      * @para IDcolSQL SQL select for the ID of the for the displayed column (KeyNamePair)
43      */

44     public Info_Column (String JavaDoc colHeader, String JavaDoc colSQL, Class JavaDoc colClass, String JavaDoc IDcolSQL)
45     {
46         this(colHeader, colSQL, colClass, true, false, IDcolSQL);
47     } // Info_Column
48

49     /**
50      * Create Info Column
51      *
52      * @para colHeader Column Header
53      * @para colSQL SQL select code for column
54      * @para colClass class of column - determines display
55      * @para readOnly column is read only
56      * @para colorColumn if true, value of column determines foreground color
57      * @para IDcolSQL SQL select for the ID of the for the displayed column
58      */

59     public Info_Column (String JavaDoc colHeader, String JavaDoc colSQL, Class JavaDoc colClass, boolean readOnly, boolean colorColumn, String JavaDoc IDcolSQL)
60     {
61         setColHeader(colHeader);
62         setColSQL(colSQL);
63         setColClass(colClass);
64         setReadOnly(readOnly);
65         setColorColumn(colorColumn);
66         setIDcolSQL(IDcolSQL);
67     } // Info_Column
68

69
70     private String JavaDoc m_colHeader;
71     private String JavaDoc m_colSQL;
72     private Class JavaDoc m_colClass;
73     private boolean m_readOnly;
74     private boolean m_colorColumn;
75     private String JavaDoc m_IDcolSQL = "";
76
77     public Class JavaDoc getColClass()
78     {
79         return m_colClass;
80     }
81     public String JavaDoc getColHeader()
82     {
83         return m_colHeader;
84     }
85     public String JavaDoc getColSQL()
86     {
87         return m_colSQL;
88     }
89     public boolean isReadOnly()
90     {
91         return m_readOnly;
92     }
93     public void setColClass(Class JavaDoc colClass)
94     {
95         m_colClass = colClass;
96     }
97     public void setColHeader(String JavaDoc colHeader)
98     {
99         m_colHeader = colHeader;
100     }
101     public void setColSQL(String JavaDoc colSQL)
102     {
103         m_colSQL = colSQL;
104     }
105     public void setReadOnly(boolean readOnly)
106     {
107         m_readOnly = readOnly;
108     }
109     public void setColorColumn(boolean colorColumn)
110     {
111         m_colorColumn = colorColumn;
112     }
113     public boolean isColorColumn()
114     {
115         return m_colorColumn;
116     }
117     /**
118      * Add ID column SQL for the displayed column
119      * The Class for this should be KeyNamePair
120      */

121     public void setIDcolSQL(String JavaDoc IDcolSQL)
122     {
123         m_IDcolSQL = IDcolSQL;
124         if (m_IDcolSQL == null)
125             m_IDcolSQL = "";
126     }
127     public String JavaDoc getIDcolSQL()
128     {
129         return m_IDcolSQL;
130     }
131     public boolean isIDcol()
132     {
133         return m_IDcolSQL.length() > 0;
134     }
135 } // infoColumn
136
Popular Tags