[ 1564520 ] Inventory Move: can't select existing attributes

http://sourceforge.net/tracker/index.php?func=detail&aid=1564520&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-03-30 16:46:22 +00:00
parent 2e1260d015
commit 423c2f57fa
1 changed files with 25 additions and 0 deletions

View File

@ -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