1
|
package eu.dnetlib.client;
|
2
|
|
3
|
import com.github.gwtbootstrap.client.ui.base.IconAnchor;
|
4
|
import com.google.gwt.dom.client.Document;
|
5
|
import com.google.gwt.dom.client.Style;
|
6
|
import com.google.gwt.event.dom.client.ClickEvent;
|
7
|
import com.google.gwt.event.dom.client.ClickHandler;
|
8
|
import com.google.gwt.user.client.History;
|
9
|
import com.google.gwt.user.client.ui.FlowPanel;
|
10
|
import com.google.gwt.user.client.ui.Label;
|
11
|
import com.google.gwt.user.client.ui.RootPanel;
|
12
|
import com.google.gwt.user.client.ui.Widget;
|
13
|
|
14
|
/**
|
15
|
* Created by stefania on 4/2/15.
|
16
|
*/
|
17
|
public class MonitorWidget implements MyWidget {
|
18
|
|
19
|
private FlowPanel monitorBudgetsPagePanel = new FlowPanel();
|
20
|
private Label monitorBudgetsTitleLabel = new Label();
|
21
|
private Label monitorBudgetsInfoLabel = new Label();
|
22
|
|
23
|
private IconAnchor monitorFundingRequests = new IconAnchor();
|
24
|
private IconAnchor monitorBudgets = new IconAnchor();
|
25
|
|
26
|
public MonitorWidget() {
|
27
|
|
28
|
monitorBudgetsPagePanel.addStyleName("content");
|
29
|
|
30
|
monitorBudgetsTitleLabel.setText("Monitor");
|
31
|
monitorBudgetsTitleLabel.addStyleName("contentTitleLabel");
|
32
|
|
33
|
monitorBudgetsInfoLabel.setText("Monitor and change the status of funding and budget requests");
|
34
|
monitorBudgetsInfoLabel.addStyleName("contentInfoLabel");
|
35
|
|
36
|
monitorFundingRequests.setText("Monitor funding requests");
|
37
|
monitorFundingRequests.setHref("#monitorFundingRequests");
|
38
|
monitorFundingRequests.addStyleName("emphasis");
|
39
|
monitorFundingRequests.addClickHandler(new ClickHandler() {
|
40
|
@Override
|
41
|
public void onClick(ClickEvent clickEvent) {
|
42
|
History.newItem("monitorFundingRequests");
|
43
|
}
|
44
|
});
|
45
|
|
46
|
monitorBudgets.setText("Monitor budgets");
|
47
|
monitorBudgets.setHref("#monitorBudgets");
|
48
|
monitorBudgets.addStyleName("emphasis");
|
49
|
monitorBudgets.addClickHandler(new ClickHandler() {
|
50
|
@Override
|
51
|
public void onClick(ClickEvent clickEvent) {
|
52
|
History.newItem("monitorBudgets");
|
53
|
}
|
54
|
});
|
55
|
|
56
|
monitorBudgetsPagePanel.add(monitorBudgetsTitleLabel);
|
57
|
monitorBudgetsPagePanel.add(monitorBudgetsInfoLabel);
|
58
|
monitorBudgetsPagePanel.add(monitorFundingRequests);
|
59
|
monitorBudgetsPagePanel.add(monitorBudgets);
|
60
|
}
|
61
|
|
62
|
@Override
|
63
|
public void clear() {
|
64
|
|
65
|
}
|
66
|
|
67
|
@Override
|
68
|
public void reload() {
|
69
|
|
70
|
Document.get().getElementById("content").removeClassName("uk-width-medium-1-1");
|
71
|
Document.get().getElementById("content").addClassName("uk-width-medium-3-4");
|
72
|
Document.get().getElementById("sidebar").getStyle().setDisplay(Style.Display.BLOCK);
|
73
|
|
74
|
SidebarPanel sidebarPanel = new SidebarPanel("Help");
|
75
|
RootPanel.get("sidebar").add(sidebarPanel.asWidget());
|
76
|
}
|
77
|
|
78
|
@Override
|
79
|
public void setToken(String token) {
|
80
|
|
81
|
}
|
82
|
|
83
|
@Override
|
84
|
public Widget asWidget() {
|
85
|
return monitorBudgetsPagePanel;
|
86
|
}
|
87
|
}
|