1 package org.kuali.student.common.ui.client.widgets.layout;
2
3 import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
4
5 import com.google.gwt.user.client.ui.HTML;
6 import com.google.gwt.user.client.ui.Panel;
7 import com.google.gwt.user.client.ui.Widget;
8
9
10
11
12
13
14 @Deprecated
15 public class ContentBlock extends VerticalFlowPanel{
16
17 private SectionTitle sectionTitle = SectionTitle.generateH2Title("");
18 private VerticalFlowPanel titlePanel = new VerticalFlowPanel();
19 private HTML description = new HTML();
20 private int size;
21
22 public ContentBlock(String blockTitle, String blockDescriptionHtml){
23 this(blockTitle, blockDescriptionHtml, 1);
24 }
25
26 public ContentBlock(String blockTitle, String blockDescriptionHtml, int blockSize){
27 sectionTitle.setText(blockTitle);
28 description.setHTML(blockDescriptionHtml);
29 titlePanel.add(sectionTitle);
30 titlePanel.add(description);
31 size = blockSize;
32 super.add(titlePanel);
33 if(blockSize == 3){
34 this.setStyleName("contentBlock-size3");
35 }
36 else if(blockSize == 2){
37 this.setStyleName("contentBlock-size2");
38 }
39 else{
40 this.setStyleName("contentBlock-size1");
41 }
42 titlePanel.setStyleName("contentBlock-titlePanel");
43 sectionTitle.setStyleName("contentBlock-title");
44 description.setStyleName("contentBlock-desc");
45 }
46
47 public int getBlockSize(){
48 return size;
49 }
50
51 @Override
52 public void add(Widget w){
53 super.add(w);
54 }
55
56 public void addBlock(ContentBlock block){
57 super.add(block);
58 }
59
60 public Panel getTitlePanel(){
61 return titlePanel;
62 }
63
64 }