[izpack-changes] r1923 - in izpack-src/trunk/src/lib/com/izforge/izpack: installer rules

noreply at berlios.de noreply at berlios.de
Thu Nov 29 16:50:27 CET 2007


Author: dreil
Date: 2007-11-29 16:50:22 +0100 (Thu, 29 Nov 2007)
New Revision: 1923

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java
   izpack-src/trunk/src/lib/com/izforge/izpack/rules/RulesEngine.java
Log:


Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java	2007-11-29 15:44:37 UTC (rev 1922)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/InstallerFrame.java	2007-11-29 15:50:22 UTC (rev 1923)
@@ -271,7 +271,7 @@
         switchPanel(0);
     }
     
-    private void refreshDynamicVariables() {
+    private void refreshDynamicVariables() {        
         if (dynamicvariables != null) {
             Iterator iter = dynamicvariables.keySet().iterator();
             while (iter.hasNext()) {
@@ -279,7 +279,7 @@
                 DynamicVariable dynvar = (DynamicVariable) dynamicvariables.get(dynvarname);
                 boolean refresh = false;
                 if (dynvar.getConditionid() != null) {
-                    if (rules.isConditionTrue(dynvar.getConditionid())) {
+                    if ((rules != null) &&  rules.isConditionTrue(dynvar.getConditionid())) {
                         // condition for this rule is true
                         refresh = true;
                     }                    

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/rules/RulesEngine.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/rules/RulesEngine.java	2007-11-29 15:44:37 UTC (rev 1922)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/rules/RulesEngine.java	2007-11-29 15:50:22 UTC (rev 1923)
@@ -71,6 +71,7 @@
     public RulesEngine(Map rules, InstallData installdata) {
         this();
         RulesEngine.installdata = installdata;
+        conditionsmap = rules;
     }
 
     /**
@@ -314,7 +315,13 @@
     
     public boolean isConditionTrue(String id)
     {
-        return this.isConditionTrue(RulesEngine.getCondition(id));
+        Condition cond = RulesEngine.getCondition(id);
+        if (cond != null) {
+            return this.isConditionTrue(cond);
+        }
+        else {
+            return false;
+        }
     }
 
     public boolean isConditionTrue(Condition cond)



More information about the izpack-changes mailing list