| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
| 192 |
ashish |
3 |
import in.shop2020.hotspot.dashbaord.client.event.ShippedOrderEvent;
|
|
|
4 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
|
|
5 |
|
| 167 |
ashish |
6 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
7 |
|
|
|
8 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
9 |
import com.google.gwt.event.dom.client.ClickHandler;
|
| 306 |
ashish |
10 |
import com.google.gwt.user.client.Random;
|
| 167 |
ashish |
11 |
import com.google.gwt.user.client.ui.Button;
|
|
|
12 |
import com.google.gwt.user.client.ui.DialogBox;
|
|
|
13 |
import com.google.gwt.user.client.ui.DockPanel;
|
|
|
14 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
15 |
import com.google.gwt.user.client.ui.Label;
|
|
|
16 |
import com.google.gwt.user.client.ui.TextBox;
|
|
|
17 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
18 |
import com.google.gwt.user.client.ui.DockPanel.DockLayoutConstant;
|
|
|
19 |
|
|
|
20 |
public class ShipmentInfoBox extends DialogBox{
|
|
|
21 |
|
|
|
22 |
private Label billNumberLabel = new Label("Airway Bill Number");
|
|
|
23 |
private Label billGeneratedByLabel = new Label("Tracker");
|
|
|
24 |
|
|
|
25 |
private Label providerLabel = new Label("Provider");
|
|
|
26 |
|
|
|
27 |
private TextBox billNumber = new TextBox();
|
|
|
28 |
private TextBox generatedBy = new TextBox();
|
|
|
29 |
private TextBox provider = new TextBox();
|
|
|
30 |
|
|
|
31 |
private Button submitbutton = new Button("Submit");
|
|
|
32 |
|
|
|
33 |
private EventBus eventBus;
|
|
|
34 |
|
|
|
35 |
private HorizontalPanel hpanel;
|
|
|
36 |
|
|
|
37 |
private VerticalPanel vpanel = new VerticalPanel();
|
|
|
38 |
|
| 192 |
ashish |
39 |
private final Order order;
|
|
|
40 |
|
|
|
41 |
public ShipmentInfoBox(final EventBus eventBus, final Order order){
|
| 167 |
ashish |
42 |
this.eventBus = eventBus;
|
| 192 |
ashish |
43 |
this.order = order;
|
| 167 |
ashish |
44 |
hpanel = new HorizontalPanel();
|
| 306 |
ashish |
45 |
hpanel.setSpacing(5);
|
| 167 |
ashish |
46 |
hpanel.add(billNumberLabel);
|
|
|
47 |
hpanel.add(billNumber);
|
| 486 |
rajveer |
48 |
|
|
|
49 |
|
|
|
50 |
billNumber.setText(order.getAirwayBillNo());
|
| 306 |
ashish |
51 |
billNumber.setEnabled(false);
|
|
|
52 |
hpanel.setCellWidth(billNumberLabel, "120px");
|
| 167 |
ashish |
53 |
vpanel.add(hpanel);
|
|
|
54 |
|
|
|
55 |
hpanel = new HorizontalPanel();
|
| 306 |
ashish |
56 |
hpanel.setSpacing(5);
|
| 167 |
ashish |
57 |
hpanel.add(billGeneratedByLabel);
|
|
|
58 |
hpanel.add(generatedBy);
|
| 306 |
ashish |
59 |
|
| 486 |
rajveer |
60 |
generatedBy.setText(order.getBilledBy());
|
| 306 |
ashish |
61 |
generatedBy.setEnabled(false);
|
|
|
62 |
hpanel.setCellWidth(billGeneratedByLabel, "120px");
|
| 167 |
ashish |
63 |
vpanel.add(hpanel);
|
|
|
64 |
hpanel = new HorizontalPanel();
|
| 306 |
ashish |
65 |
hpanel.setSpacing(5);
|
| 486 |
rajveer |
66 |
providerLabel.setVisible(false);
|
|
|
67 |
provider.setVisible(false);
|
| 167 |
ashish |
68 |
hpanel.add(providerLabel);
|
|
|
69 |
hpanel.add(provider);
|
| 306 |
ashish |
70 |
hpanel.setCellWidth(providerLabel, "120px");
|
| 167 |
ashish |
71 |
vpanel.add(hpanel);
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
vpanel.add(submitbutton);
|
|
|
75 |
/*
|
|
|
76 |
billGeneratedByLabel.setWidth("100px");
|
|
|
77 |
billNumberLabel.setWidth("100px");
|
|
|
78 |
providerLabel.setWidth("100px");
|
|
|
79 |
|
|
|
80 |
billNumber.setWidth("100px");
|
|
|
81 |
generatedBy.setWidth("100px");
|
|
|
82 |
provider.setWidth("100px");
|
|
|
83 |
*/
|
|
|
84 |
|
|
|
85 |
setWidget(vpanel);
|
|
|
86 |
setAutoHideEnabled(true);
|
|
|
87 |
setGlassEnabled(true);
|
| 306 |
ashish |
88 |
setText("Please enter shipment details");
|
|
|
89 |
//setSize("500px", "400px");
|
| 167 |
ashish |
90 |
|
|
|
91 |
setModal(true);
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
submitbutton.addClickHandler(new ClickHandler() {
|
|
|
95 |
|
|
|
96 |
@Override
|
|
|
97 |
public void onClick(ClickEvent event) {
|
|
|
98 |
// TODO Auto-generated method stub
|
|
|
99 |
hide();
|
| 192 |
ashish |
100 |
eventBus.fireEvent(new ShippedOrderEvent(order, billNumber.getText(), generatedBy.getText(), provider.getText(),true));
|
| 167 |
ashish |
101 |
clear();
|
|
|
102 |
}
|
|
|
103 |
});
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
public void clear(){
|
|
|
107 |
billNumber.setText("");
|
|
|
108 |
provider.setText("");
|
|
|
109 |
generatedBy.setText("");
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
}
|