| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| RootManForm |
|
| 1.0;1 |
| 1 | /****************************************************************************** | |
| 2 | * RootManForm.java - A bean to wrap RootMan in a form friendly package | |
| 3 | * | |
| 4 | * PicMan - The BuckoSoft Picture Manager in Java | |
| 5 | * Copyright(c) 2006 - Dick Balaska | |
| 6 | * | |
| 7 | */ | |
| 8 | package com.buckosoft.PicMan.web; | |
| 9 | ||
| 10 | import java.util.List; | |
| 11 | ||
| 12 | import com.buckosoft.BSAccount.web.BSAccountUserWebSession; | |
| 13 | import com.buckosoft.PicMan.domain.Root; | |
| 14 | ||
| 15 | /** A bean to wrap RootMan in a form friendly package | |
| 16 | * @author Dick Balaska | |
| 17 | * @since 2006/10/02 | |
| 18 | */ | |
| 19 | public class RootManForm { | |
| 20 | ||
| 21 | private List<Root> roots; | |
| 22 | private BSAccountUserWebSession userWebSession; | |
| 23 | 0 | private boolean flipFlop = false; |
| 24 | 0 | private Root newRoot = new Root(); |
| 25 | 0 | private Root editRoot = null; |
| 26 | private List<Root> rootsToDelete; | |
| 27 | private String rootToDelete; | |
| 28 | ||
| 29 | 0 | public RootManForm() { |
| 30 | 0 | } |
| 31 | ||
| 32 | /** Get the Tomcat Web UserSession | |
| 33 | * @return The Session | |
| 34 | */ | |
| 35 | 0 | public BSAccountUserWebSession getUserWebSession() { return(userWebSession); } |
| 36 | /** Set the Tomcat Web UserSession | |
| 37 | * @param userWebSession The session | |
| 38 | */ | |
| 39 | 0 | public void setUserWebSession(BSAccountUserWebSession userWebSession) { this.userWebSession = userWebSession; } |
| 40 | ||
| 41 | /** Get the List of Roots | |
| 42 | * @return The List | |
| 43 | */ | |
| 44 | 0 | public List<Root> getRoots() { return(roots); } |
| 45 | ||
| 46 | /** Set a List of all Roots for the jsp to use. | |
| 47 | * @param s The List of Roots | |
| 48 | */ | |
| 49 | public void setRoots(List<Root> s) { | |
| 50 | 0 | this.roots = s; |
| 51 | 0 | this.rootsToDelete = s; |
| 52 | 0 | } |
| 53 | ||
| 54 | /** Fetch the number roots in the roots list | |
| 55 | * @return roots.size(); | |
| 56 | */ | |
| 57 | 0 | public int getRootsCount() { return(roots.size()); } |
| 58 | ||
| 59 | /** Convienence for jsp. First call return true, next call return false, then true, etc... | |
| 60 | * @return true,false,true,false,ad nauseum | |
| 61 | */ | |
| 62 | 0 | public boolean getFlipFlop() { flipFlop = !flipFlop; return(flipFlop); } |
| 63 | ||
| 64 | /** If the user entered a new Root in the jsp, this is it. | |
| 65 | * @return A new Root | |
| 66 | */ | |
| 67 | 0 | public Root getNewRoot() { return(newRoot); } |
| 68 | // public void setNewRoot(Root s) { newRoot = s; } | |
| 69 | ||
| 70 | /** Get a List of Roots that the user wants to delete. | |
| 71 | * @return A List of Roots | |
| 72 | */ | |
| 73 | 0 | public List<Root> getRootsToDelete() { return(rootsToDelete); } |
| 74 | ||
| 75 | /** This is the Root that the user selected from the list to delete. | |
| 76 | * @return The name of the Root to delete. | |
| 77 | */ | |
| 78 | 0 | public String getRootToDelete() { return(rootToDelete); } |
| 79 | ||
| 80 | /** Set the name of the Root to delete | |
| 81 | * @param s The name of the Root | |
| 82 | */ | |
| 83 | 0 | public void setRootToDelete(String s) { rootToDelete = s; } |
| 84 | ||
| 85 | /** If we edited an existing Root, this will contain the altered Root. | |
| 86 | * @return the editRoot | |
| 87 | */ | |
| 88 | public Root getEditRoot() { | |
| 89 | 0 | return editRoot; |
| 90 | } | |
| 91 | ||
| 92 | /** If we are editing an existing Root, set this to it. <br> | |
| 93 | * If it is null, then we are not editing an existing Root | |
| 94 | * @param editRoot the editRoot to set | |
| 95 | */ | |
| 96 | public void setEditRoot(Root editRoot) { | |
| 97 | 0 | this.editRoot = editRoot; |
| 98 | 0 | } |
| 99 | } |