KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openbravo > erpCommon > ad_forms > ShowSessionStructureData


1 /*
2  *************************************************************************
3  * The contents of this file are subject to the Openbravo Public License
4  * Version 1.0 (the "License"), being the Mozilla Public License
5  * Version 1.1 with a permitted attribution clause; you may not use this
6  * file except in compliance with the License. You may obtain a copy of
7  * the License at http://www.openbravo.com/legal/license.html
8  * Software distributed under the License is distributed on an "AS IS"
9  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10  * License for the specific language governing rights and limitations
11  * under the License.
12  * The Original Code is Openbravo ERP.
13  * The Initial Developer of the Original Code is Openbravo SL
14  * All portions are Copyright (C) 2001-2006 Openbravo SL
15  * All Rights Reserved.
16  * Contributor(s): ______________________________________.
17  ************************************************************************
18 */

19 package org.openbravo.erpCommon.ad_forms;
20
21 import org.openbravo.data.FieldProvider;
22 import org.apache.log4j.Logger ;
23
24 class ShowSessionStructureData implements FieldProvider {
25   static Logger log4j = Logger.getLogger(ShowSessionStructureData.class);
26   boolean isPreference = false;
27   boolean isAccounting = false;
28   boolean isGlobal = false;
29   String JavaDoc window;
30   String JavaDoc windowName;
31   String JavaDoc completeName;
32   String JavaDoc name;
33   String JavaDoc value;
34
35
36   public String JavaDoc getField(String JavaDoc fieldName) {
37     if (fieldName.equalsIgnoreCase("isPreference"))
38       return (isPreference?"SI":"NO");
39     else if (fieldName.equalsIgnoreCase("isAccounting"))
40       return (isAccounting?"SI":"NO");
41     else if (fieldName.equalsIgnoreCase("isGlobal"))
42       return (isGlobal?"SI":"NO");
43     else if (fieldName.equalsIgnoreCase("window"))
44       return ((window==null)?"":window);
45     else if (fieldName.equalsIgnoreCase("windowName"))
46       return ((windowName==null)?"":windowName);
47     else if (fieldName.equalsIgnoreCase("completeName"))
48       return ((completeName==null)?"":completeName);
49     else if (fieldName.equalsIgnoreCase("name"))
50       return ((name==null)?"":name);
51     else if (fieldName.equalsIgnoreCase("value"))
52       return ((value==null)?"":value);
53     else {
54       if (log4j.isDebugEnabled()) log4j.debug("Field does not exist: " + fieldName);
55       return null;
56     }
57   }
58 }
59
Popular Tags