| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.client.inbox.InboxPresenter.Display;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.dom.client.Style.Unit;
|
|
|
6 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
7 |
import com.google.gwt.user.client.ui.Anchor;
|
|
|
8 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
9 |
import com.google.gwt.user.client.ui.FlexTable;
|
|
|
10 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
11 |
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
12 |
import com.google.gwt.user.client.ui.HasHTML;
|
|
|
13 |
import com.google.gwt.user.client.ui.Image;
|
|
|
14 |
import com.google.gwt.user.client.ui.SplitLayoutPanel;
|
|
|
15 |
import com.google.gwt.user.client.ui.StackLayoutPanel;
|
|
|
16 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
17 |
import com.google.gwt.user.client.ui.VerticalSplitPanel;
|
|
|
18 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
19 |
|
|
|
20 |
public class InboxWidget extends Composite implements Display{
|
|
|
21 |
|
|
|
22 |
private final HTML commandList = new HTML("Navigation");
|
|
|
23 |
private final HTML messageList = new HTML("Messages are");
|
|
|
24 |
private final HTML messageDetails = new HTML("Message Details");
|
|
|
25 |
private VerticalSplitPanel vpanel = new VerticalSplitPanel();
|
|
|
26 |
private SplitLayoutPanel sp = new SplitLayoutPanel();
|
|
|
27 |
private FlexTable orderFlextable = new FlexTable();
|
|
|
28 |
private final Anchor newOrders = new Anchor("New Orders");
|
|
|
29 |
private final Anchor billedOrders = new Anchor("Billed Orders");
|
|
|
30 |
private final Anchor acceptedOrders = new Anchor("Accepted Orders");
|
|
|
31 |
private final Anchor shippedOrders = new Anchor("Shipped Orders");
|
|
|
32 |
private final Image image = new Image("img/shop2020.jpg");
|
|
|
33 |
private Widget finalWidget = null;
|
|
|
34 |
private Widget northWidget = null;
|
|
|
35 |
|
|
|
36 |
public InboxWidget(){
|
|
|
37 |
|
|
|
38 |
StackLayoutPanel stackPanel = new StackLayoutPanel(Unit.PX);
|
|
|
39 |
addOrderLinks();
|
|
|
40 |
stackPanel.add(orderFlextable, "Orders", 25);
|
|
|
41 |
stackPanel.add(new HTML("<b>that</b>"), "Reports", 25);
|
|
|
42 |
sp.addWest(stackPanel, 200);
|
|
|
43 |
sp.addNorth(image, 30);
|
|
|
44 |
sp.add(messageDetails);
|
|
|
45 |
vpanel.setTitle("The main layout");
|
|
|
46 |
vpanel.setTopWidget(image);
|
|
|
47 |
vpanel.setBottomWidget(sp);
|
|
|
48 |
finalWidget = messageDetails;
|
|
|
49 |
initWidget(sp);
|
|
|
50 |
|
|
|
51 |
commandList.setHTML("<p> hi, how ae you doing buddy </p><ul><li>one<li>two<li>three</ul>");
|
|
|
52 |
messageDetails.setText("This has messageDetails");
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
private void addOrderLinks(){
|
|
|
56 |
orderFlextable.getColumnFormatter().setWidth(0, "200px");
|
|
|
57 |
orderFlextable.setWidget(0, 0, newOrders);
|
|
|
58 |
orderFlextable.setWidget(1, 0, acceptedOrders);
|
|
|
59 |
orderFlextable.setWidget(2, 0, billedOrders);
|
|
|
60 |
orderFlextable.setWidget(3, 0, shippedOrders);
|
|
|
61 |
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
@Override
|
|
|
65 |
public Widget asWidget() {
|
|
|
66 |
|
|
|
67 |
return this;
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
@Override
|
|
|
71 |
public HasClickHandlers getMessageBox() {
|
|
|
72 |
// TODO Auto-generated method stub
|
|
|
73 |
return null;
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
@Override
|
|
|
77 |
public void updateOrderList(OrderList orderList) {
|
|
|
78 |
if(finalWidget != null){
|
|
|
79 |
sp.remove(finalWidget);
|
|
|
80 |
}
|
|
|
81 |
if(northWidget != null){
|
|
|
82 |
sp.remove(northWidget);
|
|
|
83 |
}
|
|
|
84 |
sp.addNorth(orderList, 200);
|
|
|
85 |
this.northWidget = orderList;
|
|
|
86 |
|
|
|
87 |
sp.add(finalWidget);
|
|
|
88 |
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
@Override
|
|
|
92 |
public HasClickHandlers getAcceptedOrdersAnchor() {
|
|
|
93 |
// TODO Auto-generated method stub
|
|
|
94 |
return acceptedOrders;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
@Override
|
|
|
98 |
public HasClickHandlers getBilledOrdersAnchor() {
|
|
|
99 |
// TODO Auto-generated method stub
|
|
|
100 |
return billedOrders;
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
@Override
|
|
|
104 |
public HasClickHandlers getNewOrdersAnchor() {
|
|
|
105 |
// TODO Auto-generated method stub
|
|
|
106 |
return newOrders;
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
@Override
|
|
|
110 |
public HasClickHandlers getShippedOrdersAnchor() {
|
|
|
111 |
// TODO Auto-generated method stub
|
|
|
112 |
return shippedOrders;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
@Override
|
|
|
116 |
public void updateOrderDetails(OrderDetails details) {
|
|
|
117 |
if(finalWidget != null){
|
|
|
118 |
sp.remove(finalWidget);
|
|
|
119 |
|
|
|
120 |
}
|
|
|
121 |
sp.add(details);
|
|
|
122 |
finalWidget = details;
|
|
|
123 |
}
|
|
|
124 |
}
|