KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > print > PrintDataColumn


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-2002 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.print;
15
16 import org.compiere.util.*;
17
18 /**
19  * Print Data Column.
20  * Optional Meta Data of Columns
21  *
22  * @author Jorg Janke
23  * @version $Id: PrintDataColumn.java,v 1.5 2002/11/08 05:41:15 jjanke Exp $
24  */

25 public class PrintDataColumn
26 {
27     /**
28      * Print Data Column
29      *
30      * @param AD_Column_ID Column
31      * @param columnName Column Name
32      * @param displayType Display Type
33      * @param columnSize Column Size
34      * @param alias Alias in query or the same as column name or null
35      * @param isPageBreak if true force page break after function
36      */

37     public PrintDataColumn (int AD_Column_ID, String JavaDoc columnName,
38         int displayType, int columnSize,
39         String JavaDoc alias, boolean isPageBreak)
40     {
41         m_AD_Column_ID = AD_Column_ID;
42         m_columnName = columnName;
43         //
44
m_displayType = displayType;
45         m_columnSize = columnSize;
46         //
47
m_alias = alias;
48         if (m_alias == null)
49             m_alias = columnName;
50         m_pageBreak = isPageBreak;
51     } // PrintDataColumn
52

53     private int m_AD_Column_ID;
54     private String JavaDoc m_columnName;
55     private int m_displayType;
56     private int m_columnSize;
57     private String JavaDoc m_alias;
58     private boolean m_pageBreak;
59
60     /*************************************************************************/
61
62     /**
63      * Get AD_Column_ID
64      * @return AD_Column_ID
65      */

66     public int getAD_Column_ID()
67     {
68         return m_AD_Column_ID;
69     } // getAD_Column_ID
70

71     /**
72      * Get Column Name
73      * @return column name
74      */

75     public String JavaDoc getColumnName()
76     {
77         return m_columnName;
78     } // getColumnName
79

80     /**
81      * Get Display Type
82      * @return display type
83      */

84     public int getDisplayType()
85     {
86         return m_displayType;
87     } // getDisplayType
88

89     /**
90      * Get Alias Name
91      * @return alias column name
92      */

93     public String JavaDoc getAlias()
94     {
95         return m_alias;
96     } // getAlias
97

98     /**
99      * Column has Alias.
100      * (i.e. has a key)
101      * @return true if Alias
102      */

103     public boolean hasAlias()
104     {
105         return !m_columnName.equals(m_alias);
106     } // hasAlias
107

108     /**
109      * Column value forces page break
110      * @return true if page break
111      */

112     public boolean isPageBreak()
113     {
114         return m_pageBreak;
115     } // isPageBreak
116

117     /**
118      * String Representation
119      * @return info
120      */

121     public String JavaDoc toString()
122     {
123         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("PrintDataColumn[");
124         sb.append("ID=").append(m_AD_Column_ID)
125             .append("-").append(m_columnName);
126         if (hasAlias())
127             sb.append("(").append(m_alias).append(")");
128         sb.append(",DisplayType=").append(m_displayType)
129             .append(",Size=").append(m_columnSize)
130             .append("]");
131         return sb.toString();
132     } // toString
133

134 } // PrintDataColumn
135
Popular Tags