1
2
3
4
5
6 package com.hack23.cia.web.views.components.panels;
7
8 import thinwire.ui.Button;
9 import thinwire.ui.Component;
10 import thinwire.ui.Label;
11 import thinwire.ui.Panel;
12 import thinwire.ui.layout.TableLayout;
13
14 import com.hack23.cia.web.common.BeanLocator;
15
16 /***
17 * The Class CategoryDescriptionPanel.
18 */
19 public class CategoryDescriptionPanel extends Panel {
20
21 /***
22 * Instantiates a new category description panel.
23 *
24 * @param filePath the file path
25 * @param actionDescription the action description
26 * @param userObject the user object
27 * @param longDescription the long description
28 */
29 public CategoryDescriptionPanel(final String filePath,
30 final String actionDescription, final Object userObject,
31 final String longDescription) {
32 setLayout(new TableLayout(new double[][] { { 0, 0 },
33 { 0 } },
34 1,
35 5));
36
37 final Button actionButton = new Button(actionDescription, filePath);
38 actionButton.setLimit("0,0,1,1");
39 actionButton.setUserObject(userObject);
40 actionButton.addActionListener(Component.ACTION_CLICK, BeanLocator
41 .getApplicationActionListener());
42
43 final Label longDescriptionLabel = new Label();
44 longDescriptionLabel.setWrapText(true);
45 longDescriptionLabel.setText(longDescription);
46 longDescriptionLabel.setLimit("1,0,1,1");
47
48 getChildren().add(actionButton);
49 getChildren().add(longDescriptionLabel);
50 }
51
52 }