]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IView.js
Implement perspective auto-detection and switching
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / components / IView.js
1 /**
2 * Interface for a standard 'view' of an argeo RIA. A view is an independant applet that
3 * will be integrated inside a ViewPane.
4 * If this view is to implement a selection (a list, a tree, etc) that will trigger changes on commands,
5 * it must trigger a viewSelection#changeSelection event.
6 *
7 * The typical lifecycle of an IView will be the following :
8 * <br>+ init(viewPane) : initialize basic GUI in the viewPane
9 * <br>+ getCommands() : wire the commands and add them to the toolbars/menubars
10 * <br>+ load(data) : loads the data itself.
11 *
12 * @author Charles du Jeu
13 */
14 qx.Interface.define("org.argeo.ria.components.IView", {
15
16 properties : {
17 /**
18 * The commands definition Map that will be automatically added and wired to the menubar and toolbar.
19 * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands.
20 */
21 commands : {}
22 },
23
24 members : {
25 /**
26 * The implementation should contain the GUI initialisation.
27 * This is the role of the manager to actually add the graphical component to the pane,
28 * so it's not necessary to do it here.
29 * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager
30 * @return {Boolean}
31 */
32 init : function(viewPane){return true;},
33 /**
34 * The implementation should contain the real data loading (i.o. query...)
35 * @param data {mixed} Any data in any format
36 * @return {Boolean}
37 */
38 load : function(data){return true;},
39 /**
40 * Whether this component is already contained in a scroller (return false) or not (return true).
41 * @return {Boolean}
42 */
43 addScroll : function(){return true;}
44 }
45 });