1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.ui.client.configurable.mvc.sections;
17
18 import org.kuali.student.common.ui.client.widgets.KSLabel;
19 import org.kuali.student.common.ui.client.widgets.menus.KSListPanel;
20
21 import com.google.gwt.user.client.ui.Composite;
22
23
24
25
26
27
28
29
30 public class ValidationMessagePanel extends Composite{
31
32 private KSListPanel listPanel = new KSListPanel();
33 private int count = 0;
34 private boolean topMargin = true;
35
36 public ValidationMessagePanel(){
37 this.initWidget(listPanel);
38
39 }
40
41 public ValidationMessagePanel(boolean topMargin){
42 this.initWidget(listPanel);
43 this.topMargin = topMargin;
44 }
45
46 public void addMessage(KSLabel message){
47 if(count == 0 && topMargin){
48 message.addStyleName("ks-form-module-single-line-margin");
49 }
50 listPanel.add(message);
51 count++;
52 }
53
54 public void clear(){
55 listPanel.clear();
56 count = 0;
57 }
58
59 public int getMessageCount(){
60 return count;
61 }
62 }