1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.myfaces.custom.timednotifier;
20
21 import javax.faces.component.UIComponent;
22 import javax.faces.component.UIOutput;
23
24
25 /**
26 * Displays a timed notifier tag
27 *
28 * @JSFComponent
29 * name = "s:timedNotifier"
30 * class = "org.apache.myfaces.custom.timednotifier.TimedNotifier"
31 * tagClass = "org.apache.myfaces.custom.timednotifier.TimedNotifierTag"
32 *
33 * @author werpu
34 * Shows a Timed notifier
35 *
36 */
37 public abstract class AbstractTimedNotifier extends UIOutput {
38 public static final String COMPONENT_TYPE = "org.apache.myfaces.TimedNotifier";
39 public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.TimedNotifierRenderer";
40 private static final String DEFAULT_MESSAGE = "Ok";
41 private static final String CONTENT_FACET_NAME = "content";
42 private static final String CONFIRM_FACET_NAME = "confirm";
43
44 /**
45 * @JSFFacet
46 */
47 public UIComponent getConfirm() {
48 return (UIComponent) getFacets().get(CONFIRM_FACET_NAME);
49 }
50
51 /**
52 * confirmation message to be displayed
53 *
54 * @JSFProperty
55 * defaultValue = "Ok"
56 */
57 public abstract String getConfirmationMessage();
58
59 /**
60 * @JSFFacet
61 */
62 public UIComponent getContent() {
63 return (UIComponent) getFacets().get(CONTENT_FACET_NAME);
64 }
65
66 /**
67 * HTML: When true, this element cannot receive focus.
68 *
69 * @JSFProperty
70 */
71 public abstract Boolean getDisabled();
72
73 /**
74 * @JSFProperty
75 * tagExcluded = "true"
76 */
77 public abstract String getHeight();
78
79 /**
80 * Delay to being visible
81 *
82 * @JSFProperty
83 * defaultValue="Integer.valueOf(-1)"
84 */
85 public abstract Integer getHideDelay();
86
87 /**
88 * @JSFProperty
89 * tagExcluded = "true"
90 * defaultValue="Ok"
91 */
92 public abstract String getOkText();
93
94 /**
95 * Delay from show to hide
96 *
97 * @JSFProperty
98 * defaultValue="Integer.valueOf(0)"
99 */
100 public abstract Integer getShowDelay();
101
102 /**
103 * @JSFProperty
104 * tagExcluded = "true"
105 * defaultValue="dojoTimedNotifierDialog"
106 */
107 public abstract String getStyleClass();
108
109 /**
110 * @JSFProperty
111 * tagExcluded = "true"
112 * defaultValue="\"\""
113 */
114 public abstract String getWidth();
115
116
117 public void setConfirm(UIComponent confirm) {
118 getFacets().put(CONFIRM_FACET_NAME, confirm);
119 }
120
121 public void setContent(UIComponent content) {
122 getFacets().put(CONTENT_FACET_NAME, content);
123 }
124
125 }