001    package org.kuali.student.lum.program.client;
002    
003    import java.util.ArrayList;
004    import java.util.HashMap;
005    
006    import org.kuali.student.lum.program.client.requirements.ProgramRequirementsViewController;
007    
008    /**
009     * Program section's identifiers.
010     *
011     * @author Igor
012     */
013    public enum ProgramSections {
014        PROGRAM_DETAILS_VIEW,
015        PROGRAM_DETAILS_EDIT,
016        SPECIALIZATIONS_VIEW,
017        SPECIALIZATIONS_EDIT,
018        PROGRAM_REQUIREMENTS_VIEW,
019        PROGRAM_REQUIREMENTS_EDIT,
020        MANAGE_BODIES_VIEW,
021        MANAGE_BODIES_EDIT,
022        CATALOG_INFO_VIEW,
023        CATALOG_INFO_EDIT,
024        LEARNING_OBJECTIVES_VIEW,
025        LEARNING_OBJECTIVES_EDIT,
026        SUPPORTING_DOCUMENTS_VIEW,
027        SUPPORTING_DOCUMENTS_EDIT,
028        VIEW_ALL,
029        SUMMARY,
030        COMMENTS,
031        EMPTY;
032    
033        private static HashMap<Enum<?>, Enum<?>> sectionMap = new HashMap<Enum<?>, Enum<?>>();
034    
035        private static ArrayList<String> viewForUpdate = new ArrayList<String>();
036    
037        static{
038            viewForUpdate.add(SPECIALIZATIONS_EDIT.name());
039            viewForUpdate.add(MANAGE_BODIES_EDIT.name());
040            viewForUpdate.add(LEARNING_OBJECTIVES_EDIT.name());
041        }
042    
043        static {
044            sectionMap.put(PROGRAM_DETAILS_VIEW, PROGRAM_DETAILS_EDIT);
045            sectionMap.put(SPECIALIZATIONS_VIEW, SPECIALIZATIONS_EDIT);
046            sectionMap.put(ProgramRequirementsViewController.ProgramRequirementsViews.PREVIEW, PROGRAM_REQUIREMENTS_EDIT);
047            sectionMap.put(MANAGE_BODIES_VIEW, MANAGE_BODIES_EDIT);
048            sectionMap.put(CATALOG_INFO_VIEW, CATALOG_INFO_EDIT);
049            sectionMap.put(LEARNING_OBJECTIVES_VIEW, LEARNING_OBJECTIVES_EDIT);
050            sectionMap.put(SUPPORTING_DOCUMENTS_VIEW, SUPPORTING_DOCUMENTS_EDIT);
051        }
052    
053        public static Enum<?> getEditSection(Enum<?> viewSection) {
054            return sectionMap.get(viewSection);
055        }
056    
057        public static ArrayList<String> getViewForUpdate() {
058            return viewForUpdate;
059        }
060    }