KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > model > CalloutProduction


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

14 package org.compiere.model;
15
16 import java.util.*;
17
18 import org.compiere.util.*;
19
20 /**
21  * Production Callouts
22  *
23  * @author Jorg Janke
24  * @version $Id: CalloutProduction.java,v 1.1 2003/10/11 05:20:33 jjanke Exp $
25  */

26 public class CalloutProduction extends CalloutEngine
27 {
28     /**
29      * Product modified
30      * Set Attribute Set Instance
31      *
32      * @param ctx Context
33      * @param WindowNo current Window No
34      * @param mTab Model Tab
35      * @param mField Model Field
36      * @param value The new value
37      * @return Error message or ""
38      */

39     public String JavaDoc product (Properties ctx, int WindowNo, MTab mTab, MField mField, Object JavaDoc value)
40     {
41         Integer JavaDoc M_Product_ID = (Integer JavaDoc)value;
42         if (M_Product_ID == null || M_Product_ID.intValue() == 0)
43             return "";
44         // Set Attribute
45
if (Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue()
46             && Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0)
47             mTab.setValue("M_AttributeSetInstance_ID", new Integer JavaDoc(Env.getContextAsInt(ctx, Env.WINDOW_INFO, Env.TAB_INFO, "M_AttributeSetInstance_ID")));
48         else
49             mTab.setValue("M_AttributeSetInstance_ID", null);
50         return "";
51     } // product
52

53 } // CalloutProduction
54
Popular Tags