From 423c2f57fa420293e6ff38d4ee0bf9a6274dc4eb Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 30 Mar 2007 16:46:22 +0000 Subject: [PATCH] [ 1564520 ] Inventory Move: can't select existing attributes http://sourceforge.net/tracker/index.php?func=detail&aid=1564520&group_id=176962&atid=879332 --- dbPort/src/org/compiere/util/Env.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dbPort/src/org/compiere/util/Env.java b/dbPort/src/org/compiere/util/Env.java index 93eee8cd15..e10f002ca0 100644 --- a/dbPort/src/org/compiere/util/Env.java +++ b/dbPort/src/org/compiere/util/Env.java @@ -536,6 +536,31 @@ public final class Env return 0; } // getContextAsInt + /** + * Get Context and convert it to an integer (0 if error) + * @param ctx context + * @param WindowNo window no + * @param context context key + * @param onlyWindow if true, no defaults are used unless explicitly asked for + * @return value or 0 + */ + public static int getContextAsInt(Properties ctx, int WindowNo, String context, boolean onlyWindow) + { + String s = getContext(ctx, WindowNo, context, onlyWindow); + if (s.length() == 0) + return 0; + // + try + { + return Integer.parseInt(s); + } + catch (NumberFormatException e) + { + s_log.log(Level.SEVERE, "(" + context + ") = " + s, e); + } + return 0; + } // getContextAsInt + /** * Get Context and convert it to an integer (0 if error) * @param ctx context