Subversion Repositories eFlore/Applications.del

Rev

Rev 1503 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1239 gduche 1
package org.tela_botanica.del.client.composants.motsclesimages.propositions;
2
 
3
import org.tela_botanica.del.client.config.Config;
4
 
5
import com.google.gwt.core.client.GWT;
6
import com.google.gwt.event.dom.client.HasClickHandlers;
7
import com.google.gwt.uibinder.client.UiBinder;
8
import com.google.gwt.uibinder.client.UiField;
9
import com.google.gwt.user.client.ui.CheckBox;
10
import com.google.gwt.user.client.ui.Composite;
11
import com.google.gwt.user.client.ui.FocusPanel;
12
import com.google.gwt.user.client.ui.Image;
13
import com.google.gwt.user.client.ui.Panel;
14
import com.google.gwt.user.client.ui.Widget;
15
 
16
public class MotClePropositionVue extends Composite implements MotClePropositionPresenteur.Vue {
17
 
18
	@UiField
19
	CheckBox ajouterMotCle;
20
 
21
	@UiField
22
	Image iconeTag;
23
 
24
	@UiField
25
	FocusPanel lienMotCle;
26
 
27
	interface MyUiBinder extends UiBinder<Widget, MotClePropositionVue> {}
28
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
29
 
30
	public MotClePropositionVue() {
31
		// sets listBox
32
		initWidget(uiBinder.createAndBindUi(this));
33
	}
34
 
35
	@Override
36
	public void setMotCle(String motcle) {
37
		ajouterMotCle.setText(motcle);
38
		iconeTag.setUrl((new Config()).getUrl("iconeBaseUrl") + motcle + ".png");
39
	}
40
 
41
	public HasClickHandlers getLienMotCle() {
42
		return lienMotCle;
43
	}
44
 
45
	public void toggleCb() {
46
		boolean val = ajouterMotCle.getValue();
47
		ajouterMotCle.setValue(!ajouterMotCle.getValue());
48
	}
49
 
50
	public boolean estAAjouter() {
51
		return ajouterMotCle.getValue();
52
	}
53
 
54
	public void setEstAAjouter() {
55
		ajouterMotCle.setValue(true);
56
	}
57
 
58
	public HasClickHandlers getAjouterMotCle() {
59
		return ajouterMotCle;
60
	}
61
}