Author: bfitzpat
Date: 2012-02-29 18:47:57 -0500 (Wed, 29 Feb 2012)
New Revision: 39211
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/hierarchicalLayout.gif
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SOAPDOMParser.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeNode.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeParent.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
Log:
[JBIDE-6327] Added simplified data input for XML request messages to the WS Tester
[JBIDE-10947] For JSON & XML response data, cleaned up output with CRLF &
indentation
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/hierarchicalLayout.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/hierarchicalLayout.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2012-02-29
22:41:35 UTC (rev 39210)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2012-02-29
23:47:57 UTC (rev 39211)
@@ -140,6 +140,7 @@
JAXRSWSTestView2_Go_Tooltip=Invoke
JAXRSWSTestView2_Headers_Section=Request Headers
JAXRSWSTestView2_Msg_No_Results_Check_Headers=No textual results to display. Check
Response Headers list.
+JAXRSWSTestView2_Name_column=Name
JAXRSWSTestView2_OpenInEditor_Action=Open in Editor
JAXRSWSTestView2_Parameters_Section=Request Parameters
JAXRSWSTestView2_RequestDetails_Section=Request Details
@@ -150,8 +151,11 @@
JAXRSWSTestView2_SaveResponseText_tooltip=Save to File
JAXRSWSTestView2_ShowInBrowser_Tooltip=Show in Browser
JAXRSWSTestView2_ShowRaw_Tooltip=Show Raw
+JAXRSWSTestView2_ShowRequestTree_toolbar_btn=Show Request Tree
+JAXRSWSTestView2_ShowRequestXML_toolbar_btn=Show Request XML
JAXRSWSTestView2_Text_Msg_May_Be_Out_of_Date=Should we replace the existing request
message with one generated by your WSDL service/port/binding/operation selection?
JAXRSWSTestView2_Title_Msg_May_Be_Out_of_Date=Message May Be Incorrect for Selected WSDL
+JAXRSWSTestView2_Value_column=Value
ResultsXMLStorageInput_WS_Invocation_Results_Prefix=Web Service Invocation Results\:
WSDLBrowseDialog_Dialog_Title=Select WSDL
WSDLBrowseDialog_Error_Msg_Invalid_URL=Invalid URL specified for WSDl.
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2012-02-29
22:41:35 UTC (rev 39210)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -171,6 +171,7 @@
public static String JAXRSWSTestView2_Go_Tooltip;
public static String JAXRSWSTestView2_Headers_Section;
public static String JAXRSWSTestView2_Msg_No_Results_Check_Headers;
+ public static String JAXRSWSTestView2_Name_column;
public static String JAXRSWSTestView2_OpenInEditor_Action;
public static String JAXRSWSTestView2_Parameters_Section;
public static String JAXRSWSTestView2_RequestDetails_Section;
@@ -181,8 +182,11 @@
public static String JAXRSWSTestView2_SaveResponseText_tooltip;
public static String JAXRSWSTestView2_ShowInBrowser_Tooltip;
public static String JAXRSWSTestView2_ShowRaw_Tooltip;
+ public static String JAXRSWSTestView2_ShowRequestTree_toolbar_btn;
+ public static String JAXRSWSTestView2_ShowRequestXML_toolbar_btn;
public static String JAXRSWSTestView2_Text_Msg_May_Be_Out_of_Date;
public static String JAXRSWSTestView2_Title_Msg_May_Be_Out_of_Date;
+ public static String JAXRSWSTestView2_Value_column;
public static String ResultsXMLStorageInput_WS_Invocation_Results_Prefix;
public static String TesterWSDLUtils_WSDL_HTTPS_Secured_Inaccessible;
public static String TesterWSDLUtils_WSDL_Inaccessible;
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SOAPDOMParser.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SOAPDOMParser.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SOAPDOMParser.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSSerializer;
+import org.xml.sax.SAXException;
+
+/**
+ * Utility class for processing SOAP request XML
+ * @author bfitzpat
+ *
+ */
+public class SOAPDOMParser {
+
+ Document dom;
+ TreeParent root;
+
+ /**
+ * Parse the file into the nodes
+ * @param filepath
+ */
+ public void parseXmlFile(String fileContents){
+
+ root = new TreeParent("Invisible Root"); //$NON-NLS-1$
+
+ //get the factory
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+
+ try {
+
+ //Using factory get an instance of document builder
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ //parse using builder to get DOM representation of the XML file
+ ByteArrayInputStream bais = new ByteArrayInputStream(fileContents.getBytes());
+ dom = db.parse(bais);
+ dom.getDocumentElement().normalize();
+
+ parseDocument();
+
+ }catch(ParserConfigurationException pce) {
+ pce.printStackTrace();
+ }catch(SAXException se) {
+ se.printStackTrace();
+ }catch(IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+ /*
+ * Work through the configuration
+ */
+ private void parseDocument(){
+ //get the root elememt
+ Element docEle = dom.getDocumentElement();
+
+ TreeParent soapRoot = new TreeParent(docEle.getTagName());
+ soapRoot.setData(docEle);
+
+ processChildren(soapRoot, docEle);
+ root.addChild(soapRoot);
+ }
+
+ /*
+ * Work down the children tree
+ * @param parent
+ * @param el
+ */
+ private void processChildren ( TreeParent parent, Element el ) {
+ el.normalize();
+ parent.setData(el);
+
+ NodeList children = el.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i) instanceof Element) {
+ Element child = (Element) children.item(i);
+ String name = child.getTagName();
+ TreeParent childNode = new TreeParent(name);
+ processChildren(childNode, child);
+ parent.addChild(childNode);
+ }
+ }
+ }
+
+ /**
+ * Update the value in the XML
+ * @param input
+ * @param tp
+ * @param value
+ * @return
+ */
+ public String updateValue ( String input, TreeParent tp, String value) {
+ parseXmlFile(input);
+ dom.normalizeDocument();
+ Element docEle = dom.getDocumentElement();
+ Element toFind = (Element) tp.getData();
+ NodeList nl = docEle.getElementsByTagName(toFind.getTagName());
+ if (nl.getLength() > 0) {
+ Element found = (Element) nl.item(0);
+ if (found.getChildNodes() != null && found.getChildNodes().getLength() > 0)
{
+ Node node = found.getChildNodes().item(0);
+ node.setTextContent(value);
+
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer;
+ try {
+ transformer = transFactory.newTransformer();
+ StringWriter buffer = new StringWriter();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
//$NON-NLS-1$
+ transformer.transform(new DOMSource(docEle),
+ new StreamResult(buffer));
+ String str = buffer.toString();
+ return str;
+ } catch (TransformerConfigurationException e) {
+ e.printStackTrace();
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return the actual root
+ * @return
+ */
+ public TreeParent getRoot() {
+ return this.root;
+ }
+
+ /**
+ * Pretty print
+ * @param xml
+ * @return
+ */
+ public static String prettyPrint ( String xml ) {
+ //get the factory
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ Document dom;
+
+ try {
+
+ //Using factory get an instance of document builder
+ DocumentBuilder db = dbf.newDocumentBuilder();
+
+ //parse using builder to get DOM representation of the XML file
+ ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
+ dom = db.parse(bais);
+
+ String stringOutput = prettyPrintWithDOM3LS(dom);
+ return stringOutput;
+
+ }catch(ParserConfigurationException pce) {
+ pce.printStackTrace();
+ }catch(SAXException se) {
+ se.printStackTrace();
+ }catch(IOException ioe) {
+ ioe.printStackTrace();
+ }
+ return null;
+ }
+
+ /*
+ * @param document
+ * @return
+ */
+ static String prettyPrintWithDOM3LS(Document document) {
+ // Pretty-prints a DOM document to XML using DOM Load and Save's LSSerializer.
+ // Note that the "format-pretty-print" DOM configuration parameter can only
be set in JDK 1.6+.
+ DOMImplementation domImplementation = document.getImplementation();
+ if (domImplementation.hasFeature("LS", "3.0") &&
domImplementation.hasFeature("Core", "2.0")) {
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ DOMImplementationLS domImplementationLS = (DOMImplementationLS)
domImplementation.getFeature("LS", "3.0"); //$NON-NLS-1$
//$NON-NLS-2$
+ LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
+ DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
+ if (domConfiguration.canSetParameter("format-pretty-print", Boolean.TRUE)) {
//$NON-NLS-1$
+ lsSerializer.getDomConfig().setParameter("format-pretty-print",
Boolean.TRUE); //$NON-NLS-1$
+ LSOutput lsOutput = domImplementationLS.createLSOutput();
+ lsOutput.setEncoding("UTF-8"); //$NON-NLS-1$
+ StringWriter stringWriter = new StringWriter();
+ lsOutput.setCharacterStream(stringWriter);
+ lsSerializer.write(document, lsOutput);
+ return stringWriter.toString();
+ } else {
+ throw new RuntimeException("DOMConfiguration 'format-pretty-print'
parameter isn't settable."); //$NON-NLS-1$
+ }
+ } else {
+ throw new RuntimeException("DOM 3.0 LS and/or DOM 2.0 Core not supported.");
//$NON-NLS-1$
+ }
+ }
+
+ /**
+ * from
http://jaysonlorenzen.wordpress.com/2009/01/29/48/
+ * @param inXMLStr
+ * @return
+ */
+ public static boolean isXMLLike(String inXMLStr) {
+
+ boolean retBool = false;
+ Pattern pattern;
+ Matcher matcher;
+
+ // REGULAR EXPRESSION TO SEE IF IT AT LEAST STARTS AND ENDS
+ // WITH THE SAME ELEMENT
+ final String XML_PATTERN_STR = "<(\\S+?)(.*?)>(.*?)</\\1>";
//$NON-NLS-1$
+
+ // IF WE HAVE A STRING
+ if (inXMLStr != null && inXMLStr.trim().length() > 0) {
+
+ // IF WE EVEN RESEMBLE XML
+ if (inXMLStr.trim().startsWith("<")) { //$NON-NLS-1$
+
+ pattern = Pattern.compile(XML_PATTERN_STR,
+ Pattern.CASE_INSENSITIVE | Pattern.DOTALL | Pattern.MULTILINE);
+
+ // RETURN TRUE IF IT HAS PASSED BOTH TESTS
+ matcher = pattern.matcher(inXMLStr);
+ retBool = matcher.matches();
+ }
+ // ELSE WE ARE FALSE
+ }
+
+ return retBool;
+ }
+
+ /**
+ * Simple JSON pretty print to format JSON output
+ * @param inJSON
+ * @return
+ */
+ public static String prettyPrintJSON ( String inJSON ) {
+ int numberOfSpaces = 4;
+ String spaces = String.format("%" + numberOfSpaces + "s",
""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ inJSON = inJSON.trim();
+ if (inJSON.startsWith("{") && inJSON.endsWith("}")) {
//$NON-NLS-1$ //$NON-NLS-2$
+ String output = ""; //$NON-NLS-1$
+ char[] chars = inJSON.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ char current = chars[i];
+ switch (current) {
+ case '{':
+ output = output + current + "\r\n" + spaces; //$NON-NLS-1$
+ break;
+ case '}':
+ output = output + "\r\n" + current; //$NON-NLS-1$
+ break;
+ case ',':
+ output = output + current + "\r\n" + spaces; //$NON-NLS-1$
+ break;
+ default:
+ output = output + current;
+ break;
+ }
+ }
+ return output;
+ }
+ return inJSON;
+ }}
Property changes on:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SOAPDOMParser.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java 2012-02-29
22:41:35 UTC (rev 39210)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/SchemaUtils.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -988,7 +988,12 @@
}
if (element.getAttribute("type") != null) {//$NON-NLS-1$
elemType = element.getAttributeValue("type");//$NON-NLS-1$
- String nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ String nsprefix = ""; //$NON-NLS-1$
+ try {
+ nsprefix = elemType.substring(0, elemType.indexOf(':'));
+ } catch (StringIndexOutOfBoundsException e) {
+ // ignore
+ }
String testUri = getURIfromSchemaPrefix(element, nsprefix);
if (elemType.indexOf(':') > -1) {
if (!(elemType.startsWith("xs:") ||
elemType.startsWith("xsd:"))){ //$NON-NLS-1$ //$NON-NLS-2$
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeNode.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeNode.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeNode.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ * Simple container node
+ * @author bfitzpat
+ *
+ */
+public class TreeNode implements IAdaptable {
+
+ private String name;
+ private TreeParent parent;
+ private String ref;
+ private boolean isLockedFlag = false;
+ private Object data;
+
+ /**
+ * Constructor
+ * @param name
+ */
+ public TreeNode(String name) {
+ this.name = name;
+ }
+ /**
+ * Get the name (basic string)
+ * @return
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * Set the name (basic string)
+ * @param newName
+ */
+ public void setName(String newName) {
+ this.name = newName;
+ }
+ /**
+ * Add the parent node so we can claw back up the chain
+ * @param parent
+ */
+ public void setParent(TreeParent parent) {
+ this.parent = parent;
+ }
+ /**
+ * Get the parent node
+ * @return
+ */
+ public TreeParent getParent() {
+ return parent;
+ }
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return getName();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class key) {
+ return null;
+ }
+ /**
+ * Get the referenced node
+ * @return
+ */
+ public String getRef() {
+ return ref;
+ }
+ /**
+ * Set the referenced node
+ * @param ref
+ */
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+ /**
+ * Is this node locked for movement?
+ * @return
+ */
+ protected boolean isMovementLocked() {
+ return isLockedFlag;
+ }
+ /**
+ * Set the "isLocked" flag
+ * @param isLocked
+ */
+ protected void setIsMovementLocked(boolean isLocked) {
+ this.isLockedFlag = isLocked;
+ }
+ /**
+ * Return the stashed Java object
+ * @return
+ */
+ public Object getData() {
+ return data;
+ }
+ /**
+ * Stash a java object
+ * @param data
+ */
+ protected void setData(Object data) {
+ this.data = data;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeNode.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeParent.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeParent.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeParent.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.utils;
+
+import java.util.ArrayList;
+
+/**
+ * Extend the base node so it can track a list of children
+ * @author bfitzpat
+ */
+public class TreeParent extends TreeNode {
+
+ private ArrayList<TreeNode> children;
+ /**
+ * Constructor
+ * @param name
+ */
+ public TreeParent(String name) {
+ super(name);
+ children = new ArrayList<TreeNode>();
+ }
+ /**
+ * Add a child to the child list
+ * @param child
+ */
+ public void addChild(TreeNode child) {
+ children.add(child);
+ child.setParent(this);
+ }
+ /**
+ * Remove a child from the child list
+ * @param child
+ */
+ public void removeChild(TreeNode child) {
+ children.remove(child);
+ child.setParent(null);
+ }
+ /**
+ * Get the list of children
+ * @return
+ */
+ public TreeNode [] getChildren() {
+ return (TreeNode [])children.toArray(new TreeNode[children.size()]);
+ }
+ /**
+ * Does the node have children?
+ * @return
+ */
+ public boolean hasChildren() {
+ return children.size()>0;
+ }
+}
Property changes on:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TreeParent.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2012-02-29
22:41:35 UTC (rev 39210)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2012-02-29
23:47:57 UTC (rev 39211)
@@ -19,6 +19,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Stack;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -54,6 +55,14 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
@@ -71,6 +80,7 @@
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
@@ -90,6 +100,8 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -109,8 +121,10 @@
import org.jboss.tools.ws.ui.utils.JAXWSTester2;
import org.jboss.tools.ws.ui.utils.ResultsXMLStorage;
import org.jboss.tools.ws.ui.utils.ResultsXMLStorageInput;
+import org.jboss.tools.ws.ui.utils.SOAPDOMParser;
import org.jboss.tools.ws.ui.utils.SchemaUtils;
import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
+import org.jboss.tools.ws.ui.utils.TreeParent;
import org.jboss.tools.ws.ui.utils.WSTestUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -137,7 +151,8 @@
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String RESULT_HEADER_DELIMITER = "%";//$NON-NLS-1$
private static final String HTTPS_STRING = "https";//$NON-NLS-1$
-
+ private static final String[] TREE_COLUMNS = new String[] { "name",
"value" }; //$NON-NLS-1$ //$NON-NLS-2$
+
/**
* The ID of the view as specified by the extension.
*/
@@ -152,6 +167,11 @@
private Text bodyText;
private List resultHeadersList;
+ private TreeViewer treeRequestBody;
+ private ScrolledPageBook requestPageBook;
+ private ShowInTreeAction treeAction;
+ private ShowRawRequestAction rawRequestAction;
+
private DelimitedStringList parmsList;
private SOAPEnvelope envelope;
@@ -174,6 +194,7 @@
private static final String IMG_DESC_START = "icons/obj16/run.gif";
//$NON-NLS-1$
private static final String IMG_DESC_SHOWRAW = "icons/obj16/binary.gif";
//$NON-NLS-1$
+ private static final String IMG_DESC_SHOWTREE =
"icons/obj16/hierarchicalLayout.gif"; //$NON-NLS-1$
private static final String IMG_DESC_SHOWWEB = "icons/obj16/web.gif";
//$NON-NLS-1$
private static final String IMG_DESC_SHOWEDITOR =
"icons/obj16/properties.gif"; //$NON-NLS-1$
private static final String IMG_DESC_SAVE = "icons/obj16/save_edit.gif";
//$NON-NLS-1$
@@ -205,6 +226,11 @@
public void setJAXRS ( String url, String method ) {
this.urlCombo.setText(url);
+ this.bodyText.setText(EMPTY_STRING);
+ this.treeRequestBody.setInput(null);
+ this.resultsText.setText(EMPTY_STRING);
+ this.resultsBrowser.setText(EMPTY_STRING);
+// getCurrentHistoryEntry().setUrl(url);
String uCaseMethod = method.toUpperCase();
if (uCaseMethod.equalsIgnoreCase(GET))
this.methodCombo.setText(GET);
@@ -242,8 +268,29 @@
mImageRegistry.put(IMG_DESC_SAVE, ImageDescriptor
.createFromURL(JBossWSUIPlugin.getDefault().getBundle()
.getEntry(IMG_DESC_SAVE)));
+ mImageRegistry.put(IMG_DESC_SHOWTREE, ImageDescriptor
+ .createFromURL(JBossWSUIPlugin.getDefault().getBundle()
+ .getEntry(IMG_DESC_SHOWTREE)));
}
+ private void createRequestToolbar ( ExpandableComposite parent ) {
+
+ // create a couple of actions for toggling views
+ rawRequestAction = new ShowRawRequestAction();
+ rawRequestAction.setChecked(true);
+ treeAction = new ShowInTreeAction();
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ ToolBar toolbar = toolBarManager.createControl(parent);
+
+ toolBarManager.add(rawRequestAction);
+ toolBarManager.add(treeAction);
+
+ toolBarManager.update(true);
+
+ parent.setTextClient(toolbar);
+ }
+
private void createResponseToolbar ( ExpandableComposite parent ) {
// create a couple of actions for toggling views
@@ -349,6 +396,43 @@
}
}
+ class ShowRawRequestAction extends ToggleAction {
+ public void run() {
+ if (treeAction.isChecked()) treeAction.setChecked(false);
+
+ JAXRSWSTestView2.this.requestPageBook.showPage(PAGE1_KEY);
+ }
+ @Override
+ public String getToolTipText() {
+ return JBossWSUIMessages.JAXRSWSTestView2_ShowRequestXML_toolbar_btn;
+ }
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return mImageRegistry.getDescriptor(IMG_DESC_SHOWRAW);
+ }
+ }
+
+ class ShowInTreeAction extends ToggleAction {
+ public void run() {
+ if (rawRequestAction.isChecked()) rawRequestAction.setChecked(false);
+ if (JAXRSWSTestView2.this.bodyText.getText().length() > 0 ) {
+ JAXRSWSTestView2.this.treeRequestBody.setInput
+ (JAXRSWSTestView2.this.bodyText.getText());
+ } else {
+ JAXRSWSTestView2.this.treeRequestBody.setInput(null);
+ }
+ JAXRSWSTestView2.this.requestPageBook.showPage(PAGE2_KEY);
+ }
+ @Override
+ public String getToolTipText() {
+ return JBossWSUIMessages.JAXRSWSTestView2_ShowRequestTree_toolbar_btn;
+ }
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return mImageRegistry.getDescriptor(IMG_DESC_SHOWTREE);
+ }
+ }
+
private String getCurrentTestType() {
if (methodCombo.getText().equalsIgnoreCase(JAX_WS))
return JAX_WS;
@@ -505,6 +589,7 @@
String opNameInBody = getOpNameFromRequestBody();
if (opNameInBody == null) {
bodyText.setText(soapIn);
+ treeRequestBody.setInput(soapIn);
getCurrentHistoryEntry().setBody(soapIn);
getCurrentHistoryEntry().setAction(actionURL);
} else if (opNameInBody.contentEquals(getCurrentHistoryEntry().getOperationName()))
{
@@ -515,6 +600,7 @@
JBossWSUIMessages.JAXRSWSTestView2_Text_Msg_May_Be_Out_of_Date)) {
bodyText.setText(soapIn);
+ treeRequestBody.setInput(soapIn);
getCurrentHistoryEntry().setBody(soapIn);
getCurrentHistoryEntry().setAction(actionURL);
@@ -528,6 +614,7 @@
if (opNameInBody == null || isSOAP12 != isRequestSOAP12 ) {
bodyText.setText(soapIn);
+ treeRequestBody.setInput(soapIn);
getCurrentHistoryEntry().setBody(soapIn);
getCurrentHistoryEntry().setAction(actionURL);
} else if (opNameInBody.contentEquals(getCurrentHistoryEntry().getOperationName()))
{
@@ -538,6 +625,7 @@
JBossWSUIMessages.JAXRSWSTestView2_Text_Msg_May_Be_Out_of_Date)) {
bodyText.setText(soapIn);
+ treeRequestBody.setInput(soapIn);
getCurrentHistoryEntry().setBody(soapIn);
getCurrentHistoryEntry().setAction(actionURL);
@@ -603,7 +691,7 @@
try {
currentHistoryEntry = (TestHistoryEntry) entry.clone();
// currentHistoryEntry = entry;
- getCurrentHistoryEntry().setAction(null);
+// getCurrentHistoryEntry().setAction(null);
setControlsForSelectedEntry(entry);
} catch (CloneNotSupportedException e1) {
e1.printStackTrace();
@@ -737,7 +825,235 @@
ExpandableComposite.CLIENT_INDENT |
ExpandableComposite.EXPANDED);
ec5.setText(JBossWSUIMessages.JAXRSWSTestView2_BodyText_Section);
- bodyText = toolkit.createText(ec5, EMPTY_STRING, SWT.BORDER | SWT.WRAP |
SWT.V_SCROLL);
+ requestPageBook = toolkit.createPageBook(ec5, SWT.NONE);
+
+ createRequestToolbar(ec5);
+
+ Composite page1 = requestPageBook.createPage(PAGE1_KEY);
+ page1.setLayout(new GridLayout());
+ bodyText = toolkit.createText(page1, EMPTY_STRING, SWT.BORDER | SWT.WRAP |
SWT.V_SCROLL);
+ GridData gd7 = new GridData(SWT.FILL, SWT.FILL, true, true);
+ // gd7.minimumHeight = 100;
+ gd7.heightHint = 1;
+ bodyText.setLayoutData(gd7);
+
+ requestPageBook.showPage(PAGE1_KEY);
+
+ Composite page2 = requestPageBook.createPage(PAGE2_KEY);
+ page2.setLayout(new GridLayout());
+ treeRequestBody = new TreeViewer(page2, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL |
SWT.FULL_SELECTION );
+ JAXRSWSTestView2.this.treeRequestBody.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
+ GridData gd11 = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd11.heightHint = 1;
+ // gd10.minimumHeight = 100;
+ toolkit.adapt(treeRequestBody.getTree());
+ treeRequestBody.getTree().setLayoutData(gd11);
+ treeRequestBody.getTree().setHeaderVisible(true);
+ TreeColumn nameColumn = new TreeColumn(treeRequestBody.getTree(), SWT.LEFT);
+ nameColumn.setText(JBossWSUIMessages.JAXRSWSTestView2_Name_column);
+ nameColumn.setWidth(200);
+ TreeColumn valueColumn = new TreeColumn(treeRequestBody.getTree(), SWT.LEFT);
+ valueColumn.setText(JBossWSUIMessages.JAXRSWSTestView2_Value_column);
+ valueColumn.setWidth(200);
+
+ treeRequestBody.setColumnProperties(TREE_COLUMNS);
+
+ treeRequestBody.setLabelProvider(new ITableLabelProvider() {
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ if (element instanceof TreeParent &&
property.equalsIgnoreCase("name")) { //$NON-NLS-1$
+ return true;
+ } else if (element instanceof TreeParent &&
property.equalsIgnoreCase("value")) { //$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof TreeParent && columnIndex == 0) {
+ return ((TreeParent)element).getName();
+ } else if (element instanceof TreeParent && columnIndex == 1) {
+ TreeParent tp = (TreeParent) element;
+ if (tp.getData() != null && tp.getData() instanceof Element) {
+ Element tpelement = (Element) tp.getData();
+ if (tpelement.getChildNodes() != null &&
tpelement.getChildNodes().getLength() > 0) {
+ Node node = tpelement.getChildNodes().item(0);
+ if (node.getNodeType() == Node.TEXT_NODE) {
+ return node.getTextContent();
+ }
+ }
+ }
+ }
+ return null;
+ }
+ });
+
+ treeRequestBody.setContentProvider(new ITreeContentProvider(){
+
+ String text;
+ TreeParent tree;
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ if (newInput instanceof String) {
+ text = (String) newInput;
+ SOAPDOMParser parser = new SOAPDOMParser();
+ parser.parseXmlFile(text);
+ if (parser.getRoot().getChildren().length > 0)
+ tree = (TreeParent) parser.getRoot().getChildren()[0];
+ else
+ tree = null;
+ }
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof String && tree != null) {
+ return new Object[] {this.tree};
+ } else if (inputElement instanceof TreeParent) {
+ return ((TreeParent)inputElement).getChildren();
+ }
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement == null && tree != null) {
+ return new Object[] {this.tree};
+ } else if (parentElement instanceof TreeParent &&
((TreeParent)parentElement).hasChildren()) {
+ return ((TreeParent)parentElement).getChildren();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ if (element instanceof TreeParent) {
+ return ((TreeParent)element).getParent();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof TreeParent) {
+ return ((TreeParent)element).hasChildren();
+ }
+ return false;
+ }
+ });
+
+ treeRequestBody.setCellModifier(new ICellModifier() {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
java.lang.String)
+ */
+ public boolean canModify(Object element, String property) {
+ if (element instanceof TreeParent &&
property.equalsIgnoreCase("value")) {//$NON-NLS-1$
+ TreeParent tp = (TreeParent) element;
+ if (tp.getData() != null && tp.getData() instanceof Element) {
+ Element tpelement = (Element) tp.getData();
+ if (tpelement.getChildNodes() != null &&
tpelement.getChildNodes().getLength() > 0) {
+ Node node = tpelement.getChildNodes().item(0);
+ if (node.getNodeType() == Node.TEXT_NODE &&
node.getNodeValue().trim().length() > 0) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
java.lang.String)
+ */
+ public Object getValue(Object element, String property) {
+ TreeParent tp = (TreeParent) element;
+ if (tp.getData() != null && tp.getData() instanceof Element) {
+ Element tpelement = (Element) tp.getData();
+ if (tpelement.getChildNodes() != null &&
tpelement.getChildNodes().getLength() > 0) {
+ Node node = tpelement.getChildNodes().item(0);
+ return node.getTextContent();
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
java.lang.String, java.lang.Object)
+ */
+ public void modify(Object element, String property, Object value) {
+ TreeItem ti = (TreeItem) element;
+ TreeParent tp = (TreeParent) ti.getData();
+ if (tp.getData() != null && tp.getData() instanceof Element) {
+ Element tpelement = (Element) tp.getData();
+ if (tpelement.getChildNodes() != null &&
tpelement.getChildNodes().getLength() > 0) {
+ Node node = tpelement.getChildNodes().item(0);
+ if (node.getNodeType() == Node.TEXT_NODE) {
+ node.setTextContent((String)value);
+ treeRequestBody.update(tp, null);
+ SOAPDOMParser parser = new SOAPDOMParser();
+ String updatedOut =
+ parser.updateValue((String) treeRequestBody.getInput(), tp, (String)value);
+ if (updatedOut != null && updatedOut.trim().length() > 0) {
+ Stack<String> pathStack = new Stack<String>();
+ pathStack.push(ti.getText());
+ TreeItem tiPath = ti;
+ while (tiPath.getParentItem() != null ) {
+ tiPath = tiPath.getParentItem();
+ pathStack.push(tiPath.getText());
+ }
+ bodyText.setText(updatedOut);
+ getCurrentHistoryEntry().setBody(bodyText.getText());
+ treeRequestBody.setInput(updatedOut);
+ treeRequestBody.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
+ while (!pathStack.isEmpty()) {
+ TreeItem[] items = treeRequestBody.getTree().getItems();
+ String find = pathStack.pop();
+ /*boolean found =*/ findTreeItem(find, items);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ });
+ treeRequestBody.setCellEditors(new CellEditor[] { null, new
TextCellEditor(treeRequestBody.getTree()) });
+
+ requestPageBook.showPage(PAGE1_KEY);
+
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
//GridData.FILL_HORIZONTAL);
+ gd.heightHint = 1;
+ gd.minimumHeight = 100;
+ requestPageBook.setLayoutData(gd);
+
+ requestPageBook.showPage(PAGE1_KEY);
+
bodyText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (!restoringFromHistoryEntry)
@@ -756,7 +1072,7 @@
}
}
});
- ec5.setClient(bodyText);
+ ec5.setClient(requestPageBook);
GridData gd9 = new GridData(SWT.FILL, SWT.FILL, true, true);
gd9.minimumHeight = 200;
ec5.setLayoutData(gd9);
@@ -766,6 +1082,36 @@
section.setClient(sectionClient);
}
+// private boolean findString(String searchString, TreeItem[] treeItems) {
+// for (TreeItem treeItem : treeItems) {
+// for (int i = 0; i < tree.getColumnCount(); i++) {
+// String text = treeItem.getText(i);
+// if ((text.toUpperCase().contains(searchString.toUpperCase()))) {
+// tree.setSelection(treeItem);
+// return true;
+// }
+// }
+// }
+//
+// return false;
+// }
+
+ private boolean findTreeItem ( String name, TreeItem[] treeItems ) {
+ for (TreeItem treeItem : treeItems) {
+ for (int i = 0; i < treeRequestBody.getTree().getColumnCount(); i++) {
+ String text = treeItem.getText(i);
+ if ((text.toUpperCase().contains(name.toUpperCase()))) {
+ treeRequestBody.getTree().setSelection(treeItem);
+ return true;
+ }
+ if (treeItem.getItemCount() > 0) {
+ return findTreeItem (name, treeItem.getItems());
+ }
+ }
+ }
+ return false;
+ }
+
private TestHistoryEntry getCurrentHistoryEntry() {
if (this.currentHistoryEntry == null) {
this.currentHistoryEntry = new TestHistoryEntry();
@@ -858,8 +1204,7 @@
page2.setLayout(new GridLayout());
resultsBrowser = new Browser(page2, SWT.BORDER | SWT.WRAP );// | SWT.V_SCROLL);
GridData gd10 = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd7.heightHint = 1;
- // gd10.minimumHeight = 100;
+ gd10.heightHint = 1;
toolkit.adapt(resultsBrowser);
resultsBrowser.setLayoutData(gd10);
@@ -1123,6 +1468,16 @@
if (bodyText.isEnabled()) {
bodyText.setText(entry.getBody());
}
+ if (!treeRequestBody.getTree().isDisposed()) {
+ if (entry.getBody().trim().length() > 0) {
+ if (SOAPDOMParser.isXMLLike(entry.getBody()))
+ treeRequestBody.setInput(entry.getBody());
+ else
+ treeRequestBody.setInput(null);
+ } else {
+ treeRequestBody.setInput(null);
+ }
+ }
if (dlsList.isEnabled()) {
dlsList.setSelection(entry.getHeaders());
}
@@ -1184,8 +1539,10 @@
(methodType.equalsIgnoreCase(GET) ||
methodType.equalsIgnoreCase(OPTIONS))) {
bodyText.setEnabled(false);
+ treeRequestBody.getTree().setEnabled(false);
} else {
bodyText.setEnabled(true);
+ treeRequestBody.getTree().setEnabled(true);
}
}
@@ -1196,6 +1553,7 @@
private void setControlsForWSType ( String wsType ) {
if (wsType.equalsIgnoreCase(JAX_WS)) {
bodyText.setEnabled(true);
+ treeRequestBody.getTree().setEnabled(true);
parmsList.setEnabled(false);
parmsList.removeAll();
dlsList.setEnabled(false);
@@ -1206,17 +1564,21 @@
if (bodyText.getText().trim().length() == 0) {
bodyText.setText(emptySOAP);
+ treeRequestBody.setInput(emptySOAP);
}
openWSDLToolItem.setEnabled(true);
}
else if (wsType.equalsIgnoreCase(JAX_RS)) {
bodyText.setEnabled(true);
+ treeRequestBody.getTree().setEnabled(true);
parmsList.setEnabled(true);
dlsList.setEnabled(true);
openWSDLToolItem.setEnabled(false);
if (bodyText.getText().trim().length() > 0) {
bodyText.setText(EMPTY_STRING);
+ treeRequestBody.setInput(null);
+// getCurrentHistoryEntry().setBody(EMPTY_STRING);
}
}
setMenusForCurrentState();
@@ -1281,7 +1643,13 @@
final String url = getCurrentHistoryEntry().getUrl();
final String action = getCurrentHistoryEntry().getAction();
- final String body = getCurrentHistoryEntry().getBody();
+ String tempBody = getCurrentHistoryEntry().getBody();
+
+ // if it's XML, clean up the empty space and crlf between tags
+ if (SOAPDOMParser.isXMLLike(tempBody)) {
+ tempBody = tempBody.replaceAll(">\\s+<", "><");
//$NON-NLS-1$//$NON-NLS-2$
+ }
+ final String body = tempBody;
final String method = getCurrentHistoryEntry().getMethod();
final String headers = getCurrentHistoryEntry().getHeaders();
final String parms = getCurrentHistoryEntry().getParms();
@@ -1336,13 +1704,21 @@
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() {
if (status.getResultsText() != null) {
- getCurrentHistoryEntry().setResultText(status.getResultsText());
- JAXRSWSTestView2.this.resultsText.setText(status.getResultsText());
- JAXRSWSTestView2.this.resultsBrowser.setText(status.getResultsText());
+ String results = status.getResultsText();
+ if (SOAPDOMParser.isXMLLike(results)) {
+ results = SOAPDOMParser.prettyPrint(results);
+ } else {
+ results = SOAPDOMParser.prettyPrintJSON(results);
+ }
+ getCurrentHistoryEntry().setResultText(results);
+ getCurrentHistoryEntry().setUrl(urlCombo.getText());
+ JAXRSWSTestView2.this.resultsText.setText(results);
+ JAXRSWSTestView2.this.resultsBrowser.setText(results);
JAXRSWSTestView2.this.form.reflow(true);
}
else if (status.getMessage() != null) {
getCurrentHistoryEntry().setResultText(status.getMessage());
+ getCurrentHistoryEntry().setUrl(urlCombo.getText());
JAXRSWSTestView2.this.resultsText.setText(status.getMessage());
JAXRSWSTestView2.this.resultsBrowser.setText(status.getMessage());
JAXRSWSTestView2.this.form.reflow(true);