1
2
3
4
5
6 package com.hack23.cia.web.views.user;
7
8 import java.util.List;
9
10 import thinwire.ui.Button;
11 import thinwire.ui.Component;
12 import thinwire.ui.Label;
13 import thinwire.ui.Panel;
14 import thinwire.ui.layout.TableLayout;
15
16 import com.hack23.cia.model.application.dto.common.UserSessionDTO;
17 import com.hack23.cia.model.application.impl.common.Agency;
18 import com.hack23.cia.model.sweden.impl.CommitteeReport;
19 import com.hack23.cia.web.common.BeanLocator;
20
21 /***
22 * The Class ActionBarPanel.
23 */
24 public class ActionBarPanel extends Panel {
25
26 /*** The user session dto. */
27 private final UserSessionDTO userSessionDTO;
28
29 /***
30 * Instantiates a new action bar panel.
31 *
32 * @param userSessionDTO the user session dto
33 * @param filePath the file path
34 * @param actionDescription the action description
35 * @param userObject the user object
36 * @param commiteeReports the commitee reports
37 */
38 public ActionBarPanel(final UserSessionDTO userSessionDTO,final String filePath,
39 final String actionDescription, final Object userObject,
40 final List<CommitteeReport> commiteeReports) {
41 super();
42 this.userSessionDTO = userSessionDTO;
43 setLayout(new TableLayout(new double[][] { { 0 },
44 { 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
45 1,
46 5));
47
48 final Button actionButton = new Button(actionDescription, filePath);
49 actionButton.setLimit("0,0,1,1");
50 actionButton.setUserObject(userObject);
51 actionButton.addActionListener(Component.ACTION_CLICK, BeanLocator
52 .getApplicationActionListener());
53
54 final Panel searchPanel = new SearchPanel(userSessionDTO);
55 searchPanel.setLimit("0,1,1,2");
56
57 final Label treeViewDescription = new Label(
58 userSessionDTO
59 .getLanguageResource(Agency.LanguageContentKey.LAST_TEN_DECIDED_COMMITEE_REPORTS_DESCRIPTION));
60 treeViewDescription.setWrapText(true);
61 treeViewDescription.setLimit("0,3,1,1");
62
63 final Panel committeeReportsPanel = new CommitteeReportPanel(userSessionDTO,commiteeReports);
64
65 committeeReportsPanel.setLimit("0,4,1,5");
66 committeeReportsPanel.setUserObject(userObject);
67
68 getChildren().add(actionButton);
69 getChildren().add(searchPanel);
70 getChildren().add(treeViewDescription);
71 getChildren().add(committeeReportsPanel);
72 }
73
74 }