| 585 |
chandransh |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.shared.actions.Item;
|
|
|
4 |
|
|
|
5 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
6 |
|
|
|
7 |
import com.google.gwt.core.client.GWT;
|
|
|
8 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
9 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
10 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
11 |
import com.google.gwt.uibinder.client.UiHandler;
|
|
|
12 |
import com.google.gwt.user.client.Window;
|
|
|
13 |
import com.google.gwt.user.client.ui.Button;
|
|
|
14 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
15 |
import com.google.gwt.user.client.ui.HasText;
|
|
|
16 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
17 |
|
|
|
18 |
public class ItemDetails extends Composite implements HasText {
|
|
|
19 |
|
|
|
20 |
private static ItemDetailsUiBinder uiBinder = GWT.create(ItemDetailsUiBinder.class);
|
|
|
21 |
|
|
|
22 |
interface ItemDetailsUiBinder extends UiBinder<Widget, ItemDetails> {
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
private final EventBus eventbus;
|
|
|
26 |
private final Item item;
|
|
|
27 |
|
|
|
28 |
// public ItemDetails() {
|
|
|
29 |
// initWidget(uiBinder.createAndBindUi(this));
|
|
|
30 |
// }
|
|
|
31 |
|
|
|
32 |
@UiField
|
|
|
33 |
Button button;
|
|
|
34 |
|
|
|
35 |
public ItemDetails(EventBus eventbus, Item item){
|
|
|
36 |
this.eventbus = eventbus;
|
|
|
37 |
this.item = item;
|
|
|
38 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
39 |
button.setText(item.getManufacturerName());
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
@UiHandler("button")
|
|
|
43 |
void onClick(ClickEvent e) {
|
|
|
44 |
Window.alert("Hello!");
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
public void setText(String text) {
|
|
|
48 |
button.setText(text);
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
public String getText() {
|
|
|
52 |
return button.getText();
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
}
|