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.ClickListener;
20: import com.google.gwt.user.client.ui.Image;
21: import com.google.gwt.user.client.ui.PopupPanel;
22: import com.google.gwt.user.client.ui.Widget;
23:
24: /**
25: * This builds on the FormStyleLayout for providing common popup features in a
26: * columnar form layout, with a title and a large (ish) icon.
27: *
28: * @author Michael Neale
29: */
30: public class FormStylePopup extends PopupPanel {
31:
32: private FormStyleLayout form;
33:
34: public FormStylePopup(String image, String title) {
35: super (true);
36: form = new FormStyleLayout(image, title);
37: this .setStyleName("ks-popups-Popup");
38:
39: Image close = new ImageButton("images/close.gif");
40: close.addClickListener(new ClickListener() {
41: public void onClick(Widget w) {
42: hide();
43: }
44: });
45:
46: form.setFlexTableWidget(0, 2, close);
47: add(form);
48:
49: }
50:
51: public void addAttribute(String label, Widget wid) {
52: form.addAttribute(label, wid);
53: }
54:
55: public void addRow(Widget wid) {
56: form.addRow(wid);
57: }
58: }
|