1 /** 2 * Copyright 2005-2013 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.rice.krad.uif.widget; 17 18 /** 19 * Growls sets up settings for growls global to the current view and its pages 20 * Some basic options of the plugin are exposed through this class, however additional options 21 * can be passed through setComponentOptions as usual. 22 * However, the header and theme option is set by the growl processing in PageGroup 23 * automatically. 24 * See the jquery jGrowl plugin for more details. 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 public class Growls extends WidgetBase { 29 private static final long serialVersionUID = -8701090110933484411L; 30 31 private boolean sticky; 32 private int timeShown; 33 private String position; 34 35 /** 36 * If true, the growl will stick to the page until the user dismisses it 37 * 38 * @return the sticky 39 */ 40 public boolean isSticky() { 41 return this.sticky; 42 } 43 44 /** 45 * @param sticky the sticky to set 46 */ 47 public void setSticky(boolean sticky) { 48 this.sticky = sticky; 49 this.getComponentOptions().put("sticky", Boolean.toString(sticky)); 50 } 51 52 /** 53 * The time growls are shown in milliseconds 54 * 55 * @return the timeShown 56 */ 57 public int getTimeShown() { 58 return this.timeShown; 59 } 60 61 /** 62 * @param timeShown the timeShown to set 63 */ 64 public void setTimeShown(int timeShown) { 65 this.timeShown = timeShown; 66 this.getComponentOptions().put("life", Integer.toString(timeShown)); 67 } 68 69 /** 70 * The position for the growls to appear in the window 71 * There are five options available: top-left, top-right, bottom-left, bottom-right, center. 72 * 73 * @return the position 74 */ 75 public String getPosition() { 76 return this.position; 77 } 78 79 /** 80 * @param position the position to set 81 */ 82 public void setPosition(String position) { 83 this.position = position; 84 this.getComponentOptions().put("position", position); 85 } 86 }