1 /* 2 * Copyright 2011 The Kuali Foundation Licensed under the Educational Community 3 * License, Version 1.0 (the "License"); you may not use this file except in 4 * compliance with the License. You may obtain a copy of the License at 5 * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law 6 * or agreed to in writing, software distributed under the License is 7 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 * KIND, either express or implied. See the License for the specific language 9 * governing permissions and limitations under the License. 10 */ 11 package org.kuali.rice.kns.uif.widget; 12 13 /** 14 * Decorates a group with collapse/expand functionality 15 * 16 * @author Kuali Rice Team (rice.collab@kuali.org) 17 */ 18 public class Accordion extends WidgetBase { 19 private static final long serialVersionUID = 1238789480161901850L; 20 21 private String collapseImageSrc; 22 private String expandImageSrc; 23 24 private int animationSpeed; 25 private boolean defaultOpen; 26 private String conditionalDefaultOpen; 27 28 public Accordion() { 29 super(); 30 31 defaultOpen = true; 32 } 33 34 /** 35 * Path to the images that should be displayed to collapse the group 36 * 37 * @return String image path 38 */ 39 public String getCollapseImageSrc() { 40 return this.collapseImageSrc; 41 } 42 43 /** 44 * Setter for the collapse image path 45 * 46 * @param collapseImageSrc 47 */ 48 public void setCollapseImageSrc(String collapseImageSrc) { 49 this.collapseImageSrc = collapseImageSrc; 50 } 51 52 /** 53 * Path to the images that should be displayed to expand the group 54 * 55 * @return String image path 56 */ 57 public String getExpandImageSrc() { 58 return this.expandImageSrc; 59 } 60 61 /** 62 * Setter for the expand image path 63 * 64 * @param collapseImageSrc 65 */ 66 public void setExpandImageSrc(String expandImageSrc) { 67 this.expandImageSrc = expandImageSrc; 68 } 69 70 /** 71 * Gives the speed for the open/close animation, a smaller int will result 72 * in a faster animation 73 * 74 * @return int animation speed 75 */ 76 public int getAnimationSpeed() { 77 return this.animationSpeed; 78 } 79 80 /** 81 * Setter for the open/close animation speed 82 * 83 * @param animationSpeed 84 */ 85 public void setAnimationSpeed(int animationSpeed) { 86 this.animationSpeed = animationSpeed; 87 } 88 89 /** 90 * Indicates whether the group should be initially open 91 * 92 * @return boolean true if group should be initially open, false if it 93 * should be closed 94 */ 95 public boolean isDefaultOpen() { 96 return this.defaultOpen; 97 } 98 99 /** 100 * Setter for the default open indicator 101 * 102 * @param defaultOpen 103 */ 104 public void setDefaultOpen(boolean defaultOpen) { 105 this.defaultOpen = defaultOpen; 106 } 107 108 /** 109 * Conditional expression for the default open indicator 110 * 111 * @return String should evaluate to boolean 112 */ 113 public String getConditionalDefaultOpen() { 114 return this.conditionalDefaultOpen; 115 } 116 117 /** 118 * Setter for the conditional default open expression 119 * 120 * @param conditionalDefaultOpen 121 */ 122 public void setConditionalDefaultOpen(String conditionalDefaultOpen) { 123 this.conditionalDefaultOpen = conditionalDefaultOpen; 124 } 125 126 }