Subversion Repositories eFlore/Applications.coel

Rev

Rev 277 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 277 Rev 307
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line -... Line 2...
-
 
2
 
2
 
3
import org.tela_botanica.client.ComposantClass;
3
import org.tela_botanica.client.ComposantId;
4
import org.tela_botanica.client.ComposantId;
4
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.Mediateur;
5
import org.tela_botanica.client.RegistreId;
6
import org.tela_botanica.client.RegistreId;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
7
import org.tela_botanica.client.interfaces.Rafraichissable;
Line 28... Line 29...
28
 
29
 
Line 29... Line 30...
29
public class EntetePanneauVue extends LayoutContainer implements Rafraichissable {
30
public class EntetePanneauVue extends LayoutContainer implements Rafraichissable {
30
	
31
	
31
	private ButtonBar barreBoutons = null;
32
	private ButtonBar barreBoutons = null;
32
	private Button identificationBouton = null;
33
	private Button identificationBouton = null;
Line 33... Line 34...
33
	private String identificationInfoTpl = "<div id='coel-identification'>{0}</div>";
34
	private String identificationInfoTpl = null;
34
	private HtmlContainer identificationInfoHtml = null;
35
	private HtmlContainer identificationInfoHtml = null;
35
	
36
	
Line 36... Line 37...
36
	public EntetePanneauVue() {
37
	public EntetePanneauVue() {
37
		setLayout(new RowLayout(Orientation.HORIZONTAL));
38
		setLayout(new RowLayout(Orientation.HORIZONTAL));
38
		setId("coel-entete");
39
		setId(ComposantId.PANNEAU_ENTETE);
39
		
40
		
40
		// TODO : ajouter la gestion de l'identification
41
		// TODO : ajouter la gestion de l'identification
41
		HtmlContainer html = new HtmlContainer();
42
		HtmlContainer html = new HtmlContainer();
Line 42... Line 43...
42
		StringBuffer sb = new StringBuffer();
43
		StringBuffer sb = new StringBuffer();
-
 
44
		sb.append("	<div id='"+ComposantId.DIV_TITRE+"'>Collections en Ligne Demo</div>");
43
		sb.append("	<div id='coel-titre'>Collections en Ligne Demo</div>");
45
		html.setHtml(sb.toString());
44
		html.setHtml(sb.toString());
46
		html.setEnableState(false);
Line 45... Line 47...
45
		html.setEnableState(false);
47
		
46
		
48
		identificationInfoHtml = new HtmlContainer();
Line 69... Line 71...
69
		
71
		
70
		barreBoutons = new ButtonBar();
72
		barreBoutons = new ButtonBar();
71
		barreBoutons.setButtonAlign(Style.HorizontalAlignment.RIGHT);
73
		barreBoutons.setButtonAlign(Style.HorizontalAlignment.RIGHT);
72
		Button parametresBouton = new Button("Paramêtres", boutonEcouteur);
74
		Button parametresBouton = new Button("Paramêtres", boutonEcouteur);
73
		parametresBouton.setId(ComposantId.BTN_PARAMETRES);
75
		parametresBouton.setId(ComposantId.BTN_PARAMETRES);
74
		parametresBouton.setIconStyle("icone-param");
76
		parametresBouton.setIconStyle(ComposantClass.ICONE_PARAMETRE);
75
		barreBoutons.add(parametresBouton);
77
		barreBoutons.add(parametresBouton);
76
		Button aideBouton = new Button("Aide", boutonEcouteur);
78
		Button aideBouton = new Button("Aide", boutonEcouteur);
77
		aideBouton.setId(ComposantId.BTN_AIDE);
79
		aideBouton.setId(ComposantId.BTN_AIDE);
78
		aideBouton.setIconStyle("icone-aide");
80
		aideBouton.setIconStyle(ComposantClass.ICONE_AIDE);
79
		barreBoutons.add(aideBouton);
81
		barreBoutons.add(aideBouton);
80
		identificationBouton = new Button("Identifiez vous...", boutonEcouteur);
82
		identificationBouton = new Button("Identifiez vous...", boutonEcouteur);
81
		identificationBouton.setId(ComposantId.BTN_CONNEXION);
83
		identificationBouton.setId(ComposantId.BTN_CONNEXION);
Line 94... Line 96...
94
				Info.display(mi.getId()+" - "+mi.getText(), "Chargement du menu '{0}' en cours...", mi.getId());
96
				Info.display(mi.getId()+" - "+mi.getText(), "Chargement du menu '{0}' en cours...", mi.getId());
95
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).ouvrirApplis(ComposantId.MENU_CEL);
97
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).ouvrirApplis(ComposantId.MENU_CEL);
96
			}  
98
			}  
97
		});
99
		});
98
		menuCel.setId(ComposantId.MENU_CEL);
100
		menuCel.setId(ComposantId.MENU_CEL);
99
		menuCel.setIconStyle("icone-cel");
101
		menuCel.setIconStyle(ComposantClass.ICONE_CEL);
100
		menu.add(menuCel);
102
		menu.add(menuCel);
101
		MenuItem menuBel = new MenuItem("Biblio en ligne",  new SelectionListener<ComponentEvent>() {  
103
		MenuItem menuBel = new MenuItem("Biblio en ligne",  new SelectionListener<ComponentEvent>() {  
102
			@Override
104
			@Override
103
			public void componentSelected(ComponentEvent ce) {  
105
			public void componentSelected(ComponentEvent ce) {  
104
				Menu me = (Menu) ce.component;
106
				Menu me = (Menu) ce.component;
Line 106... Line 108...
106
				Info.display(mi.getId()+" - "+mi.getText(), "Chargement du menu '{0}' en cours...", mi.getId());
108
				Info.display(mi.getId()+" - "+mi.getText(), "Chargement du menu '{0}' en cours...", mi.getId());
107
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).ouvrirApplis(ComposantId.MENU_BEL);
109
				((Mediateur) Registry.get(RegistreId.MEDIATEUR)).ouvrirApplis(ComposantId.MENU_BEL);
108
			}  
110
			}  
109
		});
111
		});
110
		menuBel.setId(ComposantId.MENU_BEL);
112
		menuBel.setId(ComposantId.MENU_BEL);
111
		menuBel.setIconStyle("icone-bel");
113
		menuBel.setIconStyle(ComposantClass.ICONE_BEL);
112
		menu.add(menuBel);
114
		menu.add(menuBel);
Line 113... Line 115...
113
		
115
		
114
		applisBouton.setMenu(menu);
116
		applisBouton.setMenu(menu);
115
		applisBouton.setIconStyle("icone-bascule");
117
		applisBouton.setIconStyle(ComposantClass.ICONE_BASCULE);
Line 116... Line 118...
116
		barreBoutons.add(applisBouton);
118
		barreBoutons.add(applisBouton);
117
		
119
		
118
		add(html, new RowData(.3, 1));
120
		add(html, new RowData(.3, 1));
Line 126... Line 128...
126
			if (info.getType().equals("maj_utilisateur")) {
128
			if (info.getType().equals("maj_utilisateur")) {
127
				Utilisateur utilisateur = ((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT));
129
				Utilisateur utilisateur = ((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT));
128
				if (utilisateur.isIdentifie() == true) {
130
				if (utilisateur.isIdentifie() == true) {
129
					identificationInfoHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add("Bienvenue : "+utilisateur.getNomComplet())));
131
					identificationInfoHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add("Bienvenue : "+utilisateur.getNomComplet())));
130
					identificationBouton.setText("Deconnexion");
132
					identificationBouton.setText("Deconnexion");
131
					identificationBouton.setIconStyle("icone-deconnexion");
133
					identificationBouton.setIconStyle(ComposantClass.ICONE_DECONNEXION);
132
					identificationBouton.setId(ComposantId.BTN_DECONNEXION);
134
					identificationBouton.setId(ComposantId.BTN_DECONNEXION);
133
				} else {
135
				} else {
134
					identificationInfoHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add("Mode anonyme")));
136
					identificationInfoHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add("Mode anonyme")));
135
					identificationBouton.setText("Identifiez vous...");
137
					identificationBouton.setText("Identifiez vous...");
136
					identificationBouton.setIconStyle("icone-connexion");
138
					identificationBouton.setIconStyle(ComposantClass.ICONE_CONNEXION);
137
					identificationBouton.setId(ComposantId.BTN_CONNEXION);
139
					identificationBouton.setId(ComposantId.BTN_CONNEXION);
138
				}
140
				}
139
			}
141
			}
140
		} else {
142
		} else {
141
			GWT.log("Ce type d'objet n'est pas pris en compte par la méthode rafraichir de la classe EntetePanneauVue", null);
143
			GWT.log("Ce type d'objet n'est pas pris en compte par la méthode rafraichir de la classe EntetePanneauVue", null);