1
|
package eu.dnetlib.client.support;
|
2
|
|
3
|
import com.github.gwtbootstrap.client.ui.base.IconAnchor;
|
4
|
import com.google.gwt.event.dom.client.ClickEvent;
|
5
|
import com.google.gwt.event.dom.client.ClickHandler;
|
6
|
import com.google.gwt.user.client.History;
|
7
|
import com.google.gwt.user.client.ui.*;
|
8
|
import eu.dnetlib.client.MyWidget;
|
9
|
import eu.dnetlib.client.MyWidgetHelper;
|
10
|
import eu.dnetlib.client.SidebarPanel;
|
11
|
|
12
|
/**
|
13
|
* Created by stefania on 3/6/15.
|
14
|
*/
|
15
|
public class SupportWidget implements MyWidget {
|
16
|
|
17
|
private String token = "";
|
18
|
|
19
|
private FlowPanel supportPagePanel = new FlowPanel();
|
20
|
private Label supportTitleLabel = new Label();
|
21
|
private Label supportInfoLabel = new Label();
|
22
|
|
23
|
private IconAnchor eligibleProjects = new IconAnchor();
|
24
|
|
25
|
public SupportWidget() {
|
26
|
|
27
|
supportPagePanel.addStyleName("content");
|
28
|
|
29
|
supportTitleLabel.setText("Support");
|
30
|
supportTitleLabel.addStyleName("contentTitleLabel");
|
31
|
|
32
|
supportInfoLabel.setText("Find more information about: ");
|
33
|
supportInfoLabel.addStyleName("contentInfoLabel");
|
34
|
|
35
|
eligibleProjects.setText("Eligible Projects");
|
36
|
eligibleProjects.setHref("#eligibleProjects");
|
37
|
eligibleProjects.addStyleName("emphasis");
|
38
|
eligibleProjects.addClickHandler(new ClickHandler() {
|
39
|
@Override
|
40
|
public void onClick(ClickEvent clickEvent) {
|
41
|
History.newItem("eligibleProjects");
|
42
|
}
|
43
|
});
|
44
|
|
45
|
supportPagePanel.add(supportTitleLabel);
|
46
|
supportPagePanel.add(supportInfoLabel);
|
47
|
supportPagePanel.add(eligibleProjects);
|
48
|
}
|
49
|
|
50
|
@Override
|
51
|
public Widget asWidget() {
|
52
|
return supportPagePanel;
|
53
|
}
|
54
|
|
55
|
@Override
|
56
|
public void clear() {
|
57
|
|
58
|
}
|
59
|
|
60
|
@Override
|
61
|
public void reload() {
|
62
|
|
63
|
MyWidgetHelper.hideSidebar();
|
64
|
|
65
|
SidebarPanel helpPanel = new SidebarPanel("Help");
|
66
|
MyWidgetHelper.loadHelp(helpPanel, token.split("\\.")[0]);
|
67
|
}
|
68
|
|
69
|
@Override
|
70
|
public void setToken(String token) {
|
71
|
this.token = token;
|
72
|
}
|
73
|
|
74
|
@Override
|
75
|
public void afterAdditionToRootPanel() {
|
76
|
|
77
|
}
|
78
|
}
|