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.theme.Theme;
19 import org.kuali.student.common.ui.client.widgets.layout.HorizontalBlockFlowPanel;
20
21 import com.google.gwt.user.client.ui.Composite;
22 import com.google.gwt.user.client.ui.HTMLPanel;
23 import com.google.gwt.user.client.ui.Image;
24 import com.google.gwt.user.client.ui.Widget;
25
26
27
28
29
30
31
32 @Deprecated
33 public class InfoMessage extends Composite{
34 private HorizontalBlockFlowPanel layout = new HorizontalBlockFlowPanel();
35 private Image icon = Theme.INSTANCE.getCommonImages().getWarningDiamondIcon();
36 private HTMLPanel message = new HTMLPanel("");
37
38 public InfoMessage(String text, boolean visible){
39 layout.add(icon);
40 message.getElement().setInnerHTML(text);
41 layout.add(message);
42 icon.addStyleName("ks-message-static-image");
43 layout.addStyleName("ks-message-static");
44 this.initWidget(layout);
45 this.setVisible(visible);
46 }
47
48
49 public InfoMessage(){
50 icon.addStyleName("ks-message-static-image");
51 layout.add(icon);
52 layout.add(message);
53 this.initWidget(layout);
54 this.setVisible(false);
55 }
56
57 public InfoMessage(boolean visible, boolean showStyling){
58 icon.addStyleName("ks-message-static-image");
59 layout.add(icon);
60 layout.add(message);
61 this.initWidget(layout);
62 this.showWarnStyling(showStyling);
63 this.setVisible(visible);
64 }
65
66 public void setMessage(String text, boolean messageVisible){
67 message.getElement().setInnerHTML(text);
68 this.setVisible(messageVisible);
69 }
70
71 public void insert(Widget w, int beforeIndex){
72 layout.insert(w, beforeIndex);
73 }
74
75 public void add(Widget w){
76 layout.add(w);
77 }
78
79 public void showWarnStyling(boolean showStyling){
80 icon.setVisible(showStyling);
81 if(showStyling){
82 layout.addStyleName("ks-message-static");
83 }
84 else{
85 layout.removeStyleName("ks-message-static");
86 }
87 }
88 }