01: package org.drools.brms.client.common;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import com.google.gwt.user.client.ui.TextArea;
20: import com.google.gwt.user.client.ui.Widget;
21:
22: /**
23: * This presents validation error messages to the user, from the server side.
24: * Such as validation or compile errors.
25: *
26: * @author Michael Neale
27: */
28: public class ValidationMessageWidget extends FormStylePopup {
29:
30: /**
31: * The heading is the short description in bold at the top.
32: */
33: public ValidationMessageWidget(String heading, String body) {
34:
35: super ("images/attention_needed.png", heading);
36: addAttribute("Detail:", details(body));
37: //addRow( close() );
38:
39: }
40:
41: // private Widget close() {
42: // Image img = new Image("images/close.gif");
43: // img.addClickListener( new ClickListener() {
44: // public void onClick(Widget w) {
45: // hide();
46: // }
47: // } );
48: // return img;
49: // }
50:
51: private Widget details(String body) {
52: TextArea area = new TextArea();
53: area.setStyleName("editable-Surface");
54: area.setVisibleLines(12);
55: area.setText(body);
56: area.setWidth("100%");
57: return area;
58: }
59: }
|