BF [ 2017987 ] Env.getContext(TAB_INFO) should NOT use global context

This commit is contained in:
teo_sarca 2008-07-14 14:18:41 +00:00
parent 6cd8af5b79
commit fe6f073442
1 changed files with 16 additions and 12 deletions

View File

@ -37,14 +37,13 @@ import org.compiere.swing.*;
/** /**
* System Environment and static variables. * System Environment and static variables.
* <p>
* Change log:
* <ul>
* <li>2007-01-27 - teo_sarca - [ 1619390 ] Use default desktop browser as external browser
* </ul>
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ * @version $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1619390 ] Use default desktop browser as external browser
* <li>BF [ 2017987 ] Env.getContext(TAB_INFO) should NOT use global context
*/ */
public final class Env public final class Env
{ {
@ -484,19 +483,24 @@ public final class Env
} // getContext } // getContext
/** /**
* Get Value of Context for Window & Tab, * Get Value of Context for Window & Tab,
* if not found global context if available * if not found global context if available.
* @param ctx context * If TabNo is TAB_INFO only tab's context will be checked.
* @param WindowNo window no * @param ctx context
* @param TabNo tab no * @param WindowNo window no
* @param context context key * @param TabNo tab no
* @return value or "" * @param context context key
* @return value or ""
*/ */
public static String getContext (Properties ctx, int WindowNo, int TabNo, String context) public static String getContext (Properties ctx, int WindowNo, int TabNo, String context)
{ {
if (ctx == null || context == null) if (ctx == null || context == null)
throw new IllegalArgumentException ("Require Context"); throw new IllegalArgumentException ("Require Context");
String s = ctx.getProperty(WindowNo+"|"+TabNo+"|"+context); String s = ctx.getProperty(WindowNo+"|"+TabNo+"|"+context);
// If TAB_INFO, don't check Window and Global context - teo_sarca BF [ 2017987 ]
if (TAB_INFO == TabNo)
return s != null ? s : "";
//
if (s == null) if (s == null)
return getContext(ctx, WindowNo, context, false); return getContext(ctx, WindowNo, context, false);
return s; return s;