1,9 → 1,13 |
package org.tela_botanica.client; |
|
import com.google.gwt.core.client.EntryPoint; |
import com.google.gwt.user.client.Command; |
import com.google.gwt.user.client.DeferredCommand; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.WindowResizeListener; |
import com.google.gwt.user.client.ui.DockPanel; |
import com.google.gwt.user.client.ui.RootPanel; |
import com.google.gwt.user.client.ui.VerticalPanel; |
|
|
|
10,7 → 14,7 |
/** |
* Entry point classes define <code>onModuleLoad()</code>. |
*/ |
public class Cel implements EntryPoint { |
public class Cel implements EntryPoint, WindowResizeListener { |
|
|
private TopPanel topPanel = null; |
17,7 → 21,10 |
private CenterPanel centerPanel = null; |
private LeftPanel leftPanel = null; |
private EntryPanel entryPanel = null; |
private ActionPanel actionPanel = null; |
private SearchPanel searchPanel = null; |
|
private VerticalPanel rightPanel = null; |
private Mediator mediator = null; |
|
|
39,10 → 46,15 |
|
centerPanel = new CenterPanel(mediator); |
|
|
topPanel = new TopPanel(mediator); |
leftPanel = new LeftPanel(mediator); |
|
|
entryPanel = new EntryPanel(mediator); |
actionPanel = new ActionPanel(mediator); |
searchPanel = new SearchPanel(mediator); |
rightPanel = new VerticalPanel(); |
|
// Information haut de page (nom application, connexion ... etc). |
// A regler |
49,8 → 61,23 |
|
entryPanel.setStyleName("item-Input"); |
|
rightPanel.add(searchPanel); |
rightPanel.add(actionPanel); |
rightPanel.add(centerPanel); |
rightPanel.add(entryPanel); |
|
|
|
rightPanel.setWidth("100%"); |
centerPanel.setWidth("100%"); |
|
entryPanel.setWidth("100%"); |
topPanel.setWidth("100%"); |
|
|
rightPanel.setSpacing(2); |
|
|
// DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant |
// l'espace laissé. |
|
57,11 → 84,10 |
|
DockPanel outer = new DockPanel(); |
outer.add(topPanel, DockPanel.NORTH); |
outer.add(centerPanel, DockPanel.CENTER); |
outer.add(rightPanel, DockPanel.CENTER); |
outer.add(leftPanel, DockPanel.WEST); |
// outer.add(bottomPanel, DockPanel.SOUTH); |
|
centerPanel.setWidth("100%"); |
// LeftPanel : |
// Pour l'instant : relevés. |
|
68,7 → 94,7 |
outer.setWidth("100%"); |
|
outer.setSpacing(4); |
outer.setCellWidth(centerPanel, "85%"); |
outer.setCellWidth(rightPanel, "100%"); |
|
// Window.enableScrolling(false); |
Window.setMargin("0px"); |
75,16 → 101,35 |
|
mediator.onInit(); |
|
entryPanel.show(); |
|
RootPanel.get().add(outer); |
|
|
// Call the window resized handler to get the initial sizes setup. Doing |
// this in a deferred command causes it to occur after all widgets' sizes |
// have been computed by the browser. |
DeferredCommand.add(new Command() { |
public void execute() { |
onWindowResized(Window.getClientWidth(), Window.getClientHeight()); |
} |
}); |
|
|
} |
|
|
public void onWindowResized(int width, int height) { |
// Adjust the shortcut panel and detail area to take up the available room |
// in the window. |
int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8; |
if (shortcutHeight < 1) |
shortcutHeight = 1; |
leftPanel.setHeight("" + shortcutHeight); |
|
|
} |
|
|
|
|
} |