1 /**
2 * Copyright 2005-2012 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 *
21 * <p>
22 * Some basic options of the plugin are exposed through this class, however additional options
23 * can be passed through setComponentOptions as usual. However, the header and theme option is set
24 * by the growl processing in PageGroup automatically. See the jquery jGrowl plugin for more details.
25 * </p>
26 *
27 * @author Kuali Rice Team (rice.collab@kuali.org)
28 */
29 public class Growls extends WidgetBase {
30 private static final long serialVersionUID = -8701090110933484411L;
31
32 private boolean sticky;
33 private int timeShown;
34 private String position;
35
36 public Growls() {
37 super();
38 }
39
40 /**
41 * If true, the growl will stick to the page until the user dismisses it
42 *
43 * @return the sticky
44 */
45 public boolean isSticky() {
46 return this.sticky;
47 }
48
49 /**
50 * @param sticky the sticky to set
51 */
52 public void setSticky(boolean sticky) {
53 this.sticky = sticky;
54 this.getTemplateOptions().put("sticky", Boolean.toString(sticky));
55 }
56
57 /**
58 * The time growls are shown in milliseconds
59 *
60 * @return the timeShown
61 */
62 public int getTimeShown() {
63 return this.timeShown;
64 }
65
66 /**
67 * @param timeShown the timeShown to set
68 */
69 public void setTimeShown(int timeShown) {
70 this.timeShown = timeShown;
71 this.getTemplateOptions().put("life", Integer.toString(timeShown));
72 }
73
74 /**
75 * The position for the growls to appear in the window
76 * There are five options available: top-left, top-right, bottom-left, bottom-right, center.
77 *
78 * @return the position
79 */
80 public String getPosition() {
81 return this.position;
82 }
83
84 /**
85 * @param position the position to set
86 */
87 public void setPosition(String position) {
88 this.position = position;
89 this.getTemplateOptions().put("position", position);
90 }
91 }