1,15 → 1,24 |
package org.tela_botanica.del.client.composants.presenteur; |
|
import com.google.gwt.event.dom.client.ClickEvent; |
import com.google.gwt.event.dom.client.ClickHandler; |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.HTMLPanel; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.Panel; |
import com.google.gwt.user.client.ui.RootPanel; |
|
public abstract class Presenteur { |
|
private Composite vue; |
private Panel overlay; |
private Panel overlayContenu; |
|
// Constructeur |
public Presenteur(Composite vue) { |
this.vue = vue; |
|
} |
|
// Afficheur |
25,4 → 34,37 |
protected Composite getVue() { |
return this.vue; |
} |
|
public void ouvrirFenetreModale(Presenteur presenteurModal) { |
|
overlay = new HTMLPanel(""); |
overlay.setStyleName("overlay"); |
overlay.setVisible(false); |
RootPanel.get().add(overlay); |
|
overlayContenu = new HTMLPanel(""); |
overlayContenu.setStyleName("overlayContenu"); |
|
Button boutonFermer = new Button("Fermer"); |
boutonFermer.setStyleName("fermerOverlay"); |
boutonFermer.addClickHandler(new ClickHandler() { |
|
public void onClick(ClickEvent event) { |
fermerFenetreModale(); |
} |
}); |
|
presenteurModal.go(overlayContenu); |
|
RootPanel.get().add(overlayContenu); |
overlayContenu.setVisible(true); |
|
overlayContenu.add(boutonFermer); |
overlay.setVisible(true); |
} |
|
public void fermerFenetreModale() { |
RootPanel.get().remove(overlay); |
RootPanel.get().remove(overlayContenu); |
} |
} |