2 |
ddelon |
1 |
package org.tela_botanica.client;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.core.client.EntryPoint;
|
4 |
ddelon |
4 |
import com.google.gwt.i18n.client.Dictionary;
|
2 |
ddelon |
5 |
import com.google.gwt.user.client.Window;
|
|
|
6 |
import com.google.gwt.user.client.ui.DockPanel;
|
|
|
7 |
import com.google.gwt.user.client.ui.RootPanel;
|
|
|
8 |
|
|
|
9 |
import org.tela_botanica.client.TopPanel;
|
|
|
10 |
import org.tela_botanica.client.CenterPanel;
|
|
|
11 |
import org.tela_botanica.client.Shortcuts;
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* Entry point classes define <code>onModuleLoad()</code>.
|
|
|
17 |
*/
|
|
|
18 |
public class Cel implements EntryPoint {
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
private TopPanel topPanel = new TopPanel();
|
|
|
22 |
private CenterPanel centerPanel = new CenterPanel();
|
|
|
23 |
private Shortcuts shortcuts = new Shortcuts();
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* This is the entry point method.
|
|
|
27 |
*/
|
|
|
28 |
public void onModuleLoad() {
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
// Information haut de page (nom application, connexion ... etc).
|
|
|
32 |
// A regler
|
|
|
33 |
|
|
|
34 |
topPanel.setWidth("100%");
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
// DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
|
|
|
38 |
// l'espace laissé.
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
DockPanel outer = new DockPanel();
|
|
|
42 |
outer.add(topPanel, DockPanel.NORTH);
|
|
|
43 |
outer.add(centerPanel, DockPanel.CENTER);
|
|
|
44 |
outer.add(shortcuts, DockPanel.WEST);
|
|
|
45 |
|
|
|
46 |
centerPanel.setWidth("100%");
|
|
|
47 |
// Shortcuts :
|
|
|
48 |
// Pour l'instant : relevés.
|
|
|
49 |
|
|
|
50 |
outer.setWidth("100%");
|
|
|
51 |
|
|
|
52 |
outer.setSpacing(4);
|
|
|
53 |
outer.setCellWidth(centerPanel, "100%");
|
|
|
54 |
|
|
|
55 |
// Window.enableScrolling(false);
|
|
|
56 |
Window.setMargin("0px");
|
|
|
57 |
|
|
|
58 |
// Finally, add the outer panel to the RootPanel, so that it will be
|
|
|
59 |
// displayed.
|
|
|
60 |
RootPanel.get().add(outer);
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
public void onWindowResized(int width, int height) {
|
|
|
67 |
// Adjust the shortcut panel and detail area to take up the available room
|
|
|
68 |
// in the window.
|
|
|
69 |
int shortcutHeight = height - shortcuts.getAbsoluteTop() - 8;
|
|
|
70 |
if (shortcutHeight < 1)
|
|
|
71 |
shortcutHeight = 1;
|
|
|
72 |
shortcuts.setHeight("" + shortcutHeight);
|
|
|
73 |
|
|
|
74 |
}
|
4 |
ddelon |
75 |
|
|
|
76 |
public String getServiceBaseUrl() {
|
|
|
77 |
|
|
|
78 |
Dictionary theme = Dictionary.getDictionary("Parameters");
|
|
|
79 |
return theme.get("serviceBaseUrl");
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
|
2 |
ddelon |
85 |
}
|