IDEMPIERE-259 Cannot set tab display logic based on specific tab value of field

Thanks to Ammar (hamur36) for the proposed solution here:
http://sourceforge.net/projects/adempiere/forums/forum/610547/topic/5087640?message=11256178
This commit is contained in:
Carlos Ruiz 2012-05-07 15:56:25 -05:00
parent 03b9163c13
commit 162b0becf4
1 changed files with 21 additions and 3 deletions

View File

@ -83,7 +83,7 @@ public class Evaluator
* </code> * </code>
* @param source class implementing get_ValueAsString(variable) * @param source class implementing get_ValueAsString(variable)
* @param logic logic string * @param logic logic string
* @return locic result * @return logic result
*/ */
public static boolean evaluateLogic (Evaluatee source, String logic) public static boolean evaluateLogic (Evaluatee source, String logic)
{ {
@ -97,11 +97,29 @@ public class Evaluator
return false; return false;
} }
boolean retValue = evaluateLogicTuple(source, st.nextToken()); String exprStrand = st.nextToken().trim();
if (exprStrand.matches("^@\\d+$"))
{
exprStrand = exprStrand.concat(st.nextToken());
exprStrand = exprStrand.concat(st.nextToken());
}
//boolean retValue = evaluateLogicTuple(source, st.nextToken());
boolean retValue = evaluateLogicTuple(source, exprStrand);
while (st.hasMoreTokens()) while (st.hasMoreTokens())
{ {
String logOp = st.nextToken().trim(); String logOp = st.nextToken().trim();
boolean temp = evaluateLogicTuple(source, st.nextToken()); //boolean temp = evaluateLogicTuple(source, st.nextToken());
exprStrand = st.nextToken().trim();
if (exprStrand.matches("^@\\d+$"))
{
exprStrand = exprStrand.concat(st.nextToken());
exprStrand = exprStrand.concat(st.nextToken());
}
boolean temp = evaluateLogicTuple(source, exprStrand);
if (logOp.equals("&")) if (logOp.equals("&"))
retValue = retValue & temp; retValue = retValue & temp;
else if (logOp.equals("|")) else if (logOp.equals("|"))