1 19 20 package com.sslexplorer.wizard.forms; 21 22 import java.util.Iterator ; 23 import java.util.List ; 24 25 import org.apache.commons.logging.Log; 26 import org.apache.commons.logging.LogFactory; 27 28 import com.sslexplorer.wizard.WizardActionStatus; 29 30 public class AbstractWizardFinishForm extends DefaultWizardForm { 31 32 final static Log log = LogFactory.getLog(AbstractWizardFinishForm.class); 33 34 36 private List actionStatus; 38 private int errors, warnings; 39 40 public AbstractWizardFinishForm(String pageName, String resourceBundle, String resourcePrefix) { 41 super(false, false, "/WEB-INF/jsp/tiles/wizardFinish.jspf", 42 "", true, false, 43 pageName, resourceBundle, resourcePrefix, 0); 44 } 45 46 47 public void setActionStatus(List actionStatus) { 48 this.actionStatus = actionStatus; 49 50 errors = 0 ; 51 warnings = 0; 52 for(Iterator i = actionStatus.iterator(); i.hasNext(); ) { 53 WizardActionStatus status = (WizardActionStatus)i.next(); 54 if(status.getStatus() == WizardActionStatus.COMPLETED_WITH_ERRORS) { 55 errors++; 56 } 57 else if(status.getStatus() == WizardActionStatus.COMPLETED_WITH_WARNINGS) { 58 warnings++; 59 } 60 } 61 } 62 63 public String getFocussedField() { 64 return errors > 0|| warnings > 0 ? "rerun" : "finish"; 65 } 66 67 public List getActionStatus() { 68 return actionStatus; 69 } 70 71 public boolean getCompletedWithErrors() { 72 return errors > 0; 73 } 74 75 public boolean getCompletedWithWarnings() { 76 return warnings > 0; 77 } 78 79 public boolean getCompletedOk() { 80 return errors == 0 && warnings == 0; 81 } 82 } 83 | Popular Tags |