001: /*
002: * CoadunationAdmin: The admin frontend for coadunation.
003: * Copyright (C) 2007 - 2008 Rift IT Contracting
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
018: *
019: * WSDLPanel.java
020: */
021:
022: // package path
023: package com.rift.coad.web.admin.client;
024:
025: // imports
026: import com.google.gwt.user.client.ui.AbstractImagePrototype;
027: import com.google.gwt.user.client.ui.Composite;
028: import com.google.gwt.user.client.ui.ImageBundle;
029: import com.google.gwt.user.client.ui.VerticalPanel;
030: import com.google.gwt.user.client.ui.Label;
031: import com.google.gwt.user.client.ui.ScrollPanel;
032: import com.google.gwt.user.client.ui.HTML;
033: import com.google.gwt.user.client.ui.Button;
034: import com.google.gwt.user.client.ui.FlexTable;
035: import com.google.gwt.user.client.ui.TextBox;
036: import com.google.gwt.user.client.ui.ClickListener;
037: import com.google.gwt.user.client.ui.Widget;
038:
039: /**
040: * This object is responsible for displaying the WSDL panel information.
041: *
042: * @author brett chaldecott
043: */
044: public class WSDLPanel extends Composite {
045:
046: // class constants
047: private final static int MAX_DEFAULT_ROWS = 5;
048:
049: // scroll panel
050: private MethodListener listener = null;
051: private HTML url = new HTML();
052: private HTML wsdl = new HTML();
053:
054: /**
055: * Creates a new instance of WSDLPanel
056: */
057: public WSDLPanel() {
058: VerticalPanel panel = new VerticalPanel();
059: panel.setWidth("100%");
060:
061: // setup the label
062: Label objectLabel = new Label("WSDL");
063: objectLabel.setStyleName("header-Label");
064: objectLabel.setWidth("100%");
065: panel.add(objectLabel);
066:
067: VerticalPanel wsdlVerticalPanel = new VerticalPanel();
068: wsdlVerticalPanel.setWidth("100%");
069: url.setWidth("100%");
070: url.setStyleName("url-Row");
071: url.setHTML(" ");
072: wsdlVerticalPanel.add(url);
073:
074: wsdl.setHTML(" ");
075: wsdl.setWordWrap(true);
076: ScrollPanel wsdlScrollPanel = new ScrollPanel(wsdl);
077: wsdlScrollPanel.setStyleName("wsdl-Scroller");
078: wsdlScrollPanel.setWidth("100%");
079: wsdlVerticalPanel.add(wsdlScrollPanel);
080:
081: panel.add(wsdlVerticalPanel);
082:
083: // border
084: panel.setStyleName("panel-Border");
085:
086: initWidget(panel);
087:
088: }
089:
090: /**
091: * This method sets the web service definition
092: */
093: public void setWebServiceDef(WebServiceDef def) {
094: url.setHTML(def.getURL());
095: String wsdl = def.getWSDL().replaceAll("<", "<").replaceAll(
096: ">", ">").replaceAll("\n", "<br>").replaceAll(" ",
097: " ").replaceAll("\t", " ");
098: this.wsdl.setHTML(wsdl);
099: }
100: }
|