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;
|
1539 |
aurelien |
9 |
import com.google.gwt.user.client.Window;
|
1239 |
gduche |
10 |
import com.google.gwt.user.client.ui.CheckBox;
|
|
|
11 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
12 |
import com.google.gwt.user.client.ui.FocusPanel;
|
|
|
13 |
import com.google.gwt.user.client.ui.Image;
|
|
|
14 |
import com.google.gwt.user.client.ui.Panel;
|
|
|
15 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
16 |
|
|
|
17 |
public class MotClePropositionVue extends Composite implements MotClePropositionPresenteur.Vue {
|
|
|
18 |
|
|
|
19 |
@UiField
|
|
|
20 |
CheckBox ajouterMotCle;
|
|
|
21 |
|
|
|
22 |
@UiField
|
|
|
23 |
Image iconeTag;
|
|
|
24 |
|
|
|
25 |
@UiField
|
|
|
26 |
FocusPanel lienMotCle;
|
|
|
27 |
|
|
|
28 |
interface MyUiBinder extends UiBinder<Widget, MotClePropositionVue> {}
|
|
|
29 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
30 |
|
|
|
31 |
public MotClePropositionVue() {
|
|
|
32 |
// sets listBox
|
|
|
33 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
@Override
|
|
|
37 |
public void setMotCle(String motcle) {
|
|
|
38 |
ajouterMotCle.setText(motcle);
|
|
|
39 |
iconeTag.setUrl((new Config()).getUrl("iconeBaseUrl") + motcle + ".png");
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
public HasClickHandlers getLienMotCle() {
|
|
|
43 |
return lienMotCle;
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
public void toggleCb() {
|
|
|
47 |
boolean val = ajouterMotCle.getValue();
|
|
|
48 |
ajouterMotCle.setValue(!ajouterMotCle.getValue());
|
1539 |
aurelien |
49 |
if(ajouterMotCle.getValue()) {
|
|
|
50 |
addStyleName("motClePictoCoche");
|
|
|
51 |
} else {
|
|
|
52 |
removeStyleName("motClePictoCoche");
|
|
|
53 |
}
|
1239 |
gduche |
54 |
}
|
|
|
55 |
|
|
|
56 |
public boolean estAAjouter() {
|
|
|
57 |
return ajouterMotCle.getValue();
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
public void setEstAAjouter() {
|
|
|
61 |
ajouterMotCle.setValue(true);
|
1539 |
aurelien |
62 |
addStyleName("motClePictoCoche");
|
1239 |
gduche |
63 |
}
|
|
|
64 |
|
|
|
65 |
public HasClickHandlers getAjouterMotCle() {
|
|
|
66 |
return ajouterMotCle;
|
|
|
67 |
}
|
|
|
68 |
}
|