Rev 293 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
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.HasWidgets;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RootPanel;
public abstract class Presenteur {
private Panel overlay;
private Panel overlayContenu;
private PresenteurVue presenteurVue;
private boolean fenetreModaleOuverte = false;
// Constructeur
public Presenteur() {
}
// Afficheur
public void go() {
go(null);
}
public abstract void go(HasWidgets composite);
// Gestion des évènements
protected abstract void gererEvenements();
public void ouvrirFenetreModale(Presenteur presenteurModal) {
presenteurVue = new PresenteurVue();
overlay = presenteurVue.overlay;
overlay.setStyleName("overlay");
overlay.setVisible(false);
RootPanel.get().add(overlay);
overlayContenu = presenteurVue.overlayContenu;
overlayContenu.setStyleName("overlayContenu");
Button boutonFermer = presenteurVue.boutonFermer;
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);
fenetreModaleOuverte = true;
}
public boolean fenetreModaleEstOuverte() {
return fenetreModaleOuverte;
}
public void fermerFenetreModale() {
overlay.clear();
overlayContenu.clear();
RootPanel.get().remove(overlay);
RootPanel.get().remove(overlayContenu);
fenetreModaleOuverte = false;
}
}