01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.script;
14:
15: import java.util.EventListener;
16:
17: /**
18: * Script Listener is a interface declaring a (untypized) script which should be executed on an
19: * untypized Event.
20: *
21: * <p>Typical instance is {@link JavaScriptListener}
22: *
23: * @author Holger Engels
24: */
25: public interface ScriptListener extends EventListener {
26:
27: /**
28: * A default value for {@link #getPriority()}
29: */
30: final int DEFAULT_PRIORITY = 0;
31:
32: /**
33: * A high priority value for {@link #getPriority()}
34: */
35: final int HIGH_PRIORITY = 100;
36:
37: /**
38: * A low priority value for {@link #getPriority()}
39: */
40: final int LOW_PRIORITY = -100;
41:
42: /**
43: * Event on which this script should be triggered.
44: */
45: String getEvent();
46:
47: /**
48: * Inline code which should be executed on occuration of this event
49: * @return Inline Code
50: */
51: String getCode();
52:
53: /**
54: * Optional, additional script code which should be rendered externally (i.e. external .JS file).
55: * @return Optional scripting code, may be <code>null</code>
56: */
57: String getScript();
58:
59: /**
60: * A numeric value which prioritzes the execution order of various script listeners listening on the same event.
61: * @return {@link #DEFAULT_PRIORITY} if you don't care.
62: * Lower values are executed later (low priority), higher values eraliert (higher priority).
63: */
64: int getPriority();
65:
66: // SComponent[] getComponents();
67: }
|