Project

General

Profile

1
package eu.dnetlib.client.fundingrequest.stepinfo;
2

    
3
import com.google.gwt.i18n.client.DateTimeFormat;
4
import com.google.gwt.user.client.ui.HTML;
5
import com.google.gwt.user.client.ui.IsWidget;
6
import com.google.gwt.user.client.ui.Widget;
7
import eu.dnetlib.goldoa.domain.Project;
8

    
9
/**
10
 * Created by stefania on 3/30/15.
11
 */
12
public class ProjectInlineInfo implements IsWidget {
13

    
14
    private HTML projectInlineInfo = new HTML();
15
    private String projectInfoContents = "";
16

    
17
    private DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy/MM/dd");
18

    
19
    public ProjectInlineInfo(Project project) {
20

    
21
        projectInfoContents = "<div class=\"displayInlineInfo\">";
22

    
23
        projectInfoContents += "<dl><dt class=\"chronologySubTitle\">PROJECT</dt></dl>";
24

    
25
        projectInfoContents += "<dd>";
26
        if(project.getAcronym() != null)
27
            projectInfoContents += project.getAcronym();
28

    
29
        if(project.getTitle() != null)
30
            projectInfoContents += " - " + project.getTitle();
31

    
32
        if(project.getFunder()!=null)
33
            projectInfoContents += ", " + project.getFunder();
34

    
35
        if(project.getFundingString()!=null)
36
            projectInfoContents += "/" + project.getFundingString();
37

    
38
        if(project.getScientificArea() != null)
39
            projectInfoContents += "/" + project.getScientificArea();
40

    
41
        if(project.getCall() != null)
42
            projectInfoContents += ", " + project.getCall();
43

    
44
        if(project.getGrant() != null)
45
            projectInfoContents += ", " + project.getGrant();
46

    
47
        if (project.getStartDate() != null)
48
            projectInfoContents += ", " + dtf.format(project.getStartDate());
49

    
50
        if (project.getEndDate() != null)
51
            projectInfoContents += " - " + dtf.format(project.getEndDate());
52

    
53
        if(project.getUrl() != null)
54
            projectInfoContents += ", " + project.getUrl();
55
        projectInfoContents += "</dd>";
56

    
57
        projectInfoContents += "</div>";
58
        projectInlineInfo.setHTML(projectInfoContents);
59
    }
60

    
61
    @Override
62
    public Widget asWidget() {
63
        return projectInlineInfo;
64
    }
65

    
66
    public void addStyleName(String styleName) {
67
        projectInlineInfo.addStyleName(styleName);
68
    }
69
}
(16-16/27)