[izpack-changes] r1702 - izpack-src/trunk/src/lib/com/izforge/izpack/panels

noreply at berlios.de noreply at berlios.de
Thu Jan 11 14:55:08 CET 2007


Author: dreil
Date: 2007-01-11 14:55:06 +0100 (Thu, 11 Jan 2007)
New Revision: 1702

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/panels/PacksModel.java
Log:
fixed: required packs are not grayed out any more


Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/PacksModel.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/PacksModel.java	2007-01-11 11:50:25 UTC (rev 1701)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/PacksModel.java	2007-01-11 13:55:06 UTC (rev 1702)
@@ -320,8 +320,7 @@
     public void setValueAt(Object aValue, int rowIndex, int columnIndex)
     {
         if (columnIndex == 0)
-        {
-            System.out.println("Change value: " + aValue);
+        {            
             if (aValue instanceof Integer)
             {
                 Pack pack = (Pack) packs.get(rowIndex);
@@ -329,15 +328,23 @@
                 if (((Integer) aValue).intValue() == 1)
                 {
                     String packid = pack.id;
-                    if (packid != null){
-                        System.out.println("packid="+packid);
+                    if (packid != null){                        
                         if (this.rules.canInstallPack(packid, this.variables) || this.rules.canInstallPackOptional(packid, this.variables)){
-                            System.out.println("can install");
-                            checkValues[rowIndex] = 1;
+                            if (pack.required){
+                                checkValues[rowIndex] = -1;
+                            }
+                            else {
+                                checkValues[rowIndex] = 1;
+                            }
                         }                              
                     }
                     else {
-                        checkValues[rowIndex] = 1;
+                        if (pack.required){
+                            checkValues[rowIndex] = -1;
+                        }
+                        else {
+                            checkValues[rowIndex] = 1;
+                        }
                     }                    
                     updateExcludes(rowIndex);
                     updateDeps();
@@ -417,7 +424,10 @@
                     if (!(!this.rules.canInstallPack(packid, this.variables) && this.rules.canInstallPackOptional(packid, this.variables))){
                         propRequirement(pack.name);
                     }                    
-                }                
+                }  
+                else {
+                    propRequirement(pack.name);
+                }
             }
         }
 




More information about the izpack-changes mailing list