001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.krad.uif.component;
017    
018    /**
019     * Declares methods for determining which client side events are supported by a
020     * <code>Component</code> and methods for retrieving the event code
021     * 
022     * <p>
023     * The code returned by the get*Script methods will be wrapped in the
024     * appropriate event registration code, therefore only the body needs to be
025     * returned
026     * </p>
027     * 
028     * @author Kuali Rice Team (rice.collab@kuali.org)
029     */
030    public interface ScriptEventSupport {
031    
032            /**
033             * Indicates whether the component supports the onLoad event
034             * 
035             * @return boolean true if event is supported, false if the event is not
036             *         supported
037             */
038            public boolean getSupportsOnLoad();
039    
040            /**
041             * Script that should be executed when the component's onLoad event is fired
042             * 
043             * @return String JavaScript code
044             */
045            public String getOnLoadScript();
046    
047        /**
048         * Setter for the onLoad script
049         *
050         * @param script - script for on load
051         */
052        public void setOnLoadScript(String script);
053    
054            /**
055             * Indicates whether the component supports the document ready event
056             * 
057             * @return boolean true if event is supported, false if the event is not
058             *         supported
059             */
060            public boolean getSupportsOnDocumentReady();
061    
062            /**
063             * Script to be run when the document ready event is triggered
064             * 
065             * @return the onDocumentReadyScript
066             */
067            public String getOnDocumentReadyScript();
068    
069            /**
070             * Indicates whether the component supports the onUnload event
071             * 
072             * @return boolean true if event is supported, false if the event is not
073             *         supported
074             */
075            public boolean getSupportsOnUnload();
076    
077            /**
078             * Script that should be executed when the component's onUnload event is
079             * fired
080             * 
081             * @return String JavaScript code
082             */
083            public String getOnUnloadScript();
084    
085            /**
086             * Indicates whether the component supports the onClose event
087             * 
088             * @return boolean true if event is supported, false if the event is not
089             *         supported
090             */
091            public boolean getSupportsOnClose();
092    
093            /**
094             * Script that should be executed when the component's onClose event is
095             * fired
096             * 
097             * @return String JavaScript code
098             */
099            public String getOnCloseScript();
100    
101            /**
102             * Indicates whether the component supports the onBlur event
103             * 
104             * @return boolean true if event is supported, false if the event is not
105             *         supported
106             */
107            public boolean getSupportsOnBlur();
108    
109            /**
110             * Script that should be executed when the component's onBlur event is fired
111             * 
112             * @return String JavaScript code
113             */
114            public String getOnBlurScript();
115    
116        /**
117         * Setter for the onblur script
118         *
119         * @param script
120         */
121        public void setOnBlurScript(String script);
122    
123            /**
124             * Indicates whether the component supports the onChange event
125             * 
126             * @return boolean true if event is supported, false if the event is not
127             *         supported
128             */
129            public boolean getSupportsOnChange();
130    
131            /**
132             * Script that should be executed when the component's onChange event is
133             * fired
134             * 
135             * @return String JavaScript code
136             */
137            public String getOnChangeScript();
138    
139            /**
140             * Indicates whether the component supports the onClick event
141             * 
142             * @return boolean true if event is supported, false if the event is not
143             *         supported
144             */
145            public boolean getSupportsOnClick();
146    
147            /**
148             * Script that should be executed when the component's onClick event is
149             * fired
150             * 
151             * @return String JavaScript code
152             */
153            public String getOnClickScript();
154    
155            /**
156             * Indicates whether the component supports the onDblClick event
157             * 
158             * @return boolean true if event is supported, false if the event is not
159             *         supported
160             */
161            public boolean getSupportsOnDblClick();
162    
163            /**
164             * Script that should be executed when the component's onDblClick event is
165             * fired
166             * 
167             * @return String JavaScript code
168             */
169            public String getOnDblClickScript();
170    
171            /**
172             * Indicates whether the component supports the onFocus event
173             * 
174             * @return boolean true if event is supported, false if the event is not
175             *         supported
176             */
177            public boolean getSupportsOnFocus();
178    
179            /**
180             * Script that should be executed when the component's onFocus event is
181             * fired
182             * 
183             * @return String JavaScript code
184             */
185            public String getOnFocusScript();
186    
187            /**
188             * Indicates whether the component supports the onSubmit event
189             * 
190             * @return boolean true if event is supported, false if the event is not
191             *         supported
192             */
193            public boolean getSupportsOnSubmit();
194    
195            /**
196             * Script that should be executed when the component's onSubmit event is
197             * fired
198             * 
199             * @return String JavaScript code
200             */
201            public String getOnSubmitScript();
202    
203            /**
204             * Indicates whether the component supports the onKeyPress event
205             * 
206             * @return boolean true if event is supported, false if the event is not
207             *         supported
208             */
209            public boolean getSupportsOnKeyPress();
210    
211            /**
212             * Script that should be executed when the component's onKeyPress event is
213             * fired
214             * 
215             * @return String JavaScript code
216             */
217            public String getOnKeyPressScript();
218    
219            /**
220             * Indicates whether the component supports the onKeyUp event
221             * 
222             * @return boolean true if event is supported, false if the event is not
223             *         supported
224             */
225            public boolean getSupportsOnKeyUp();
226    
227            /**
228             * Script that should be executed when the component's onKeyUp event is
229             * fired
230             * 
231             * @return String JavaScript code
232             */
233            public String getOnKeyUpScript();
234    
235            /**
236             * Indicates whether the component supports the onKeyDown event
237             * 
238             * @return boolean true if event is supported, false if the event is not
239             *         supported
240             */
241            public boolean getSupportsOnKeyDown();
242    
243            /**
244             * Script that should be executed when the component's onKeyDown event is
245             * fired
246             * 
247             * @return String JavaScript code
248             */
249            public String getOnKeyDownScript();
250    
251            /**
252             * Indicates whether the component supports the onMouseOver event
253             * 
254             * @return boolean true if event is supported, false if the event is not
255             *         supported
256             */
257            public boolean getSupportsOnMouseOver();
258    
259            /**
260             * Script that should be executed when the component's onMouseOver event is
261             * fired
262             * 
263             * @return String JavaScript code
264             */
265            public String getOnMouseOverScript();
266    
267            /**
268             * Indicates whether the component supports the onMouseOut event
269             * 
270             * @return boolean true if event is supported, false if the event is not
271             *         supported
272             */
273            public boolean getSupportsOnMouseOut();
274    
275            /**
276             * Script that should be executed when the component's onMouseOut event is
277             * fired
278             * 
279             * @return String JavaScript code
280             */
281            public String getOnMouseOutScript();
282    
283            /**
284             * Indicates whether the component supports the onMouseUp event
285             * 
286             * @return boolean true if event is supported, false if the event is not
287             *         supported
288             */
289            public boolean getSupportsOnMouseUp();
290    
291            /**
292             * Script that should be executed when the component's onMouseUp event is
293             * fired
294             * 
295             * @return String JavaScript code
296             */
297            public String getOnMouseUpScript();
298    
299            /**
300             * Indicates whether the component supports the onMouseDown event
301             * 
302             * @return boolean true if event is supported, false if the event is not
303             *         supported
304             */
305            public boolean getSupportsOnMouseDown();
306    
307            /**
308             * Script that should be executed when the component's onMouseDown event is
309             * fired
310             * 
311             * @return String JavaScript code
312             */
313            public String getOnMouseDownScript();
314    
315            /**
316             * Indicates whether the component supports the onMouseMove event
317             * 
318             * @return boolean true if event is supported, false if the event is not
319             *         supported
320             */
321            public boolean getSupportsOnMouseMove();
322    
323            /**
324             * Script that should be executed when the component's onMouseMove event is
325             * fired
326             * 
327             * @return String JavaScript code
328             */
329            public String getOnMouseMoveScript();
330    
331    }