KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > tools > Country


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.tools;
15
16 import java.util.*;
17
18 import org.compiere.model.*;
19 import org.compiere.util.*;
20
21 /**
22  * Country
23  *
24  * @author Jorg Janke
25  * @version $Id: Country.java,v 1.2 2002/11/11 07:03:22 jjanke Exp $
26  */

27 public class Country extends PO
28 {
29     /**
30      * Country
31      * @param ctx context
32      * @param C_Country_ID country
33      */

34     public Country(Properties ctx, int C_Country_ID)
35     {
36         super (ctx, C_Country_ID);
37         // Default Setting
38
if (C_Country_ID == 0)
39         {
40             setValue("HasRegion", new Boolean JavaDoc(false));
41             setValue("HasPostal", new Boolean JavaDoc(false));
42             setValue("IsDefault", new Boolean JavaDoc(false));
43         }
44     } // Country
45

46     /**
47      * Initialize and return PO_Info
48      * @param ctx context
49      * @return POInfo
50      */

51     protected POInfo initPO (Properties ctx)
52     {
53         int AD_Table_ID = 170;
54         POInfo poi = POInfo.getPOInfo (ctx, AD_Table_ID);
55         return poi;
56     } // initPO
57

58     /*************************************************************************/
59
60     /**
61      * Create Country
62      * @param Name name
63      * @return country
64      */

65     public static Country create(String JavaDoc Name)
66     {
67         Country c = new Country(Env.getCtx(), 0);
68         c.setValue("Name", Name);
69         c.save();
70         return c;
71     } // create
72

73 } // Country
74

75
Popular Tags