1 19 20 package com.sslexplorer.core.forms; 21 22 import javax.servlet.http.HttpServletRequest ; 23 24 import org.apache.struts.action.ActionMapping; 25 26 import com.sslexplorer.navigation.FavoriteResourceType; 27 import com.sslexplorer.wizard.AbstractWizardSequence; 28 29 35 public abstract class AbstractFavoriteResourceDetailsWizardForm extends AbstractResourceDetailsWizardForm { 36 37 41 public static final String ATTR_FAVORITE = "favorite"; 42 43 45 private boolean favorite; 46 47 62 public AbstractFavoriteResourceDetailsWizardForm(boolean nextAvailable, boolean previousAvailable, String page, String focussedField, 63 boolean autoComplete, boolean finishAvailable, String pageName, String resourceBundle, 64 String resourcePrefix, int stepIndex, FavoriteResourceType resourceTypeForAccessRights) { 65 super(nextAvailable, previousAvailable, page, focussedField, autoComplete, finishAvailable, pageName, resourceBundle, resourcePrefix, stepIndex, resourceTypeForAccessRights); 66 } 67 68 74 public void setFavorite(boolean favorite) { 75 this.favorite = favorite; 76 } 77 78 84 public boolean getFavorite() { 85 return favorite; 86 } 87 88 89 90 93 public void reset(ActionMapping mapping, HttpServletRequest request) { 94 super.reset(mapping, request); 95 AbstractWizardSequence sequence = this.getWizardSequence(); 96 if (sequence != null){ 97 if (this.getWizardSequence().getAttribute(ATTR_FAVORITE, "").toString().equals("")) 98 favorite = false; 99 } 100 } 101 102 105 public void apply(AbstractWizardSequence sequence) throws Exception { 106 super.apply(sequence); 107 sequence.putAttribute(ATTR_FAVORITE, Boolean.valueOf(favorite)); 108 } 109 110 } 111 | Popular Tags |