01: /*
02: * CoadunationAdmin: The admin frontend for coadunation.
03: * Copyright (C) 2007 - 2008 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * ResultPanel.java
20: */
21:
22: // package path
23: package com.rift.coad.web.admin.client;
24:
25: // imports
26: import com.google.gwt.user.client.Window;
27: import com.google.gwt.user.client.ui.AbstractImagePrototype;
28: import com.google.gwt.user.client.ui.Composite;
29: import com.google.gwt.user.client.ui.ImageBundle;
30: import com.google.gwt.user.client.ui.ScrollPanel;
31: import com.google.gwt.user.client.ui.VerticalPanel;
32: import com.google.gwt.user.client.ui.Label;
33: import com.google.gwt.user.client.ui.HTML;
34:
35: /**
36: * The result panel
37: *
38: * @author brett chaldecott
39: */
40: public class ResultPanel extends Composite {
41:
42: // private member variables
43: private ScrollPanel scrollPanel = null;
44: private HTML text = null;
45:
46: /**
47: * Creates a new instance of ResultPanel
48: */
49: public ResultPanel() {
50: VerticalPanel panel = new VerticalPanel();
51: panel.setWidth("100%");
52: panel.setStyleName("panel-Border");
53: Label objectLabel = new Label("Result");
54: objectLabel.setStyleName("header-Label");
55: objectLabel.setWidth("100%");
56: panel.add(objectLabel);
57: text = new HTML();
58: text.setHTML(" ");
59: scrollPanel = new ScrollPanel(text);
60: scrollPanel.setWidth("100%");
61: scrollPanel.setStyleName("method-Result-Scroller");
62: panel.add(scrollPanel);
63:
64: initWidget(panel);
65:
66: }
67:
68: /**
69: * This method sets the result text.
70: */
71: public void setResult(String result) {
72: text.setHTML(result.replaceAll("<", "<").replaceAll(">",
73: ">").replaceAll("\n", "<br>").replaceAll(" ",
74: " ").replaceAll("\t", " "));
75: }
76: }
|