[jbosstools-commits] JBoss Tools SVN: r22793 - in trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui: views and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jun 14 12:46:15 EDT 2010


Author: bfitzpat
Date: 2010-06-14 12:46:15 -0400 (Mon, 14 Jun 2010)
New Revision: 22793

Modified:
   trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java
   trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
   trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java
Log:
JBIDE-6457 - fixing issue with viewing SOAP response messages, generating sample SOAP request messages, and updated the WSDL Browse Dialog so it can be used in another context as well as to select the service/port/operation. 

Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java	2010-06-14 15:37:08 UTC (rev 22792)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/TesterWSDLUtils.java	2010-06-14 16:46:15 UTC (rev 22793)
@@ -343,7 +343,7 @@
 								if (temp.getAttribute(NAME_ATTR) != null) 
 									rootName = temp.getAttribute(NAME_ATTR).getValue();
 								
-								if (rootName.equalsIgnoreCase(messageName)) {
+								if (rootName != null && rootName.equalsIgnoreCase(messageName)) {
 									StringBuffer buf = new StringBuffer();
 									buf.append('<' + rootName);
 									buf.append(" xmlns = \"" + wsdlDefinition.getTargetNamespace() + "\""); //$NON-NLS-1$ //$NON-NLS-2$

Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java	2010-06-14 15:37:08 UTC (rev 22792)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java	2010-06-14 16:46:15 UTC (rev 22793)
@@ -414,6 +414,9 @@
 										if (node3.getNodeType() == Node.TEXT_NODE) {
 											string = node3.getNodeValue();
 											break;
+										} else if (node3.getNodeType() == Node.ELEMENT_NODE) {
+											string = node2.toString();
+											break;
 										}
 									}
 								}

Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java	2010-06-14 15:37:08 UTC (rev 22792)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/WSDLBrowseDialog.java	2010-06-14 16:46:15 UTC (rev 22793)
@@ -90,12 +90,20 @@
 	private List opList;
 	private Group group;
 	private Label portLabel;
+	private boolean showServicePortOperaton = true;
 
 	public WSDLBrowseDialog(Shell parentShell) {
 		super(parentShell);
 		setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE );
 	}
 	
+	public void setShowServicePortOperation (boolean flag ){
+		this.showServicePortOperaton = flag;
+	}
+	public boolean getShowServicePortOperation() {
+		return this.showServicePortOperaton;
+	}
+	
 	public String getWSDLText(){
 		return WSDLBrowseDialog.wsdlTextValue;
 	}
@@ -161,9 +169,11 @@
 			public void modifyText(ModifyEvent arg0) {
 				IStatus status = validate();
 				if (status != Status.OK_STATUS) {
-					setGroupEnabled(false);
+					if (showServicePortOperaton)
+						setGroupEnabled(false);
 				} else {
-					setGroupEnabled(true);
+					if (showServicePortOperaton)
+						setGroupEnabled(true);
 				}
 			}
 		});
@@ -217,7 +227,8 @@
 								locationCombo.setText(testURL.toExternalForm());
 								wsdlDefinition =
 									TesterWSDLUtils.readWSDLURL(testURL);
-								updateServiceCombo();
+								if (showServicePortOperaton)
+									updateServiceCombo();
 							} catch (MalformedURLException e) {
 								e.printStackTrace();
 							} catch (WSDLException e) {
@@ -258,7 +269,8 @@
 						locationCombo.setText(testURL.toExternalForm());
 						wsdlDefinition =
 							TesterWSDLUtils.readWSDLURL(testURL);
-						updateServiceCombo();
+						if (showServicePortOperaton)
+							updateServiceCombo();
 					} catch (MalformedURLException e) {
 						JBossWSUIPlugin.log(e);
 					} catch (WSDLException e) {
@@ -297,7 +309,8 @@
 						locationCombo.setText(testURL.toExternalForm());
 						wsdlDefinition =
 							TesterWSDLUtils.readWSDLURL(testURL);
-						updateServiceCombo();
+						if (showServicePortOperaton)
+							updateServiceCombo();
 					} catch (MalformedURLException e) {
 						JBossWSUIPlugin.log(e);
 					} catch (WSDLException e) {
@@ -307,60 +320,64 @@
 			}
 		});
 		
-		group = new Group(mainComposite, SWT.NONE);
-		group.setText(JBossWSUIMessages.WSDLBrowseDialog_Group_Title);
-		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
-		gridData.horizontalSpan = 2;
-		group.setLayoutData(gridData);
-		group.setLayout(new GridLayout(2, false));
+		if (this.showServicePortOperaton) {
+			group = new Group(mainComposite, SWT.NONE);
+			group.setText(JBossWSUIMessages.WSDLBrowseDialog_Group_Title);
+			gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+			gridData.horizontalSpan = 2;
+			group.setLayoutData(gridData);
+			group.setLayout(new GridLayout(2, false));
+			
+			serviceLabel = new Label(group, SWT.NONE);
+			serviceLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Service_Field);
+	
+			gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+			serviceCombo = new Combo(group, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY );
+			serviceCombo.setLayoutData(gridData);
+			serviceCombo.addSelectionListener(new SelectionListener(){
+				public void widgetDefaultSelected(SelectionEvent arg0) {
+					updatePortCombo();
+				}
+				public void widgetSelected(SelectionEvent arg0) {
+					widgetDefaultSelected(arg0);
+				}
+			});
+			
+			portLabel = new Label(group, SWT.NONE);
+			portLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Port_Field);
+	
+			gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+			portCombo = new Combo(group, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
+			portCombo.setLayoutData(gridData);
+			portCombo.addSelectionListener(new SelectionListener(){
+				public void widgetDefaultSelected(SelectionEvent arg0) {
+					updateOperationList();
+				}
+				public void widgetSelected(SelectionEvent arg0) {
+					widgetDefaultSelected(arg0);
+				}
+			});
+	
+			operationLabel = new Label(group, SWT.NONE);
+			operationLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Operation_Field);
+	
+			gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+			gridData.verticalSpan = 3;
+			gridData.heightHint = 50;
+			opList = new List(group, SWT.BORDER | SWT.V_SCROLL );
+			opList.setLayoutData(gridData);
+			opList.addSelectionListener(new SelectionListener(){
+				public void widgetDefaultSelected(SelectionEvent arg0) {
+					WSDLBrowseDialog.this.operationTextValue = opList.getSelection()[0];
+				}
+				public void widgetSelected(SelectionEvent arg0) {
+					widgetDefaultSelected(arg0);
+				}
+			});
+		}
 		
-		serviceLabel = new Label(group, SWT.NONE);
-		serviceLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Service_Field);
+		mainComposite.pack();
 
-		gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
-		serviceCombo = new Combo(group, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY );
-		serviceCombo.setLayoutData(gridData);
-		serviceCombo.addSelectionListener(new SelectionListener(){
-			public void widgetDefaultSelected(SelectionEvent arg0) {
-				updatePortCombo();
-			}
-			public void widgetSelected(SelectionEvent arg0) {
-				widgetDefaultSelected(arg0);
-			}
-		});
-		
-		portLabel = new Label(group, SWT.NONE);
-		portLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Port_Field);
-
-		gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
-		portCombo = new Combo(group, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
-		portCombo.setLayoutData(gridData);
-		portCombo.addSelectionListener(new SelectionListener(){
-			public void widgetDefaultSelected(SelectionEvent arg0) {
-				updateOperationList();
-			}
-			public void widgetSelected(SelectionEvent arg0) {
-				widgetDefaultSelected(arg0);
-			}
-		});
-
-		operationLabel = new Label(group, SWT.NONE);
-		operationLabel.setText(JBossWSUIMessages.WSDLBrowseDialog_Operation_Field);
-
-		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
-		gridData.verticalSpan = 3;
-		gridData.heightHint = 50;
-		opList = new List(group, SWT.BORDER | SWT.V_SCROLL );
-		opList.setLayoutData(gridData);
-		opList.addSelectionListener(new SelectionListener(){
-			public void widgetDefaultSelected(SelectionEvent arg0) {
-				WSDLBrowseDialog.this.operationTextValue = opList.getSelection()[0];
-			}
-			public void widgetSelected(SelectionEvent arg0) {
-				widgetDefaultSelected(arg0);
-			}
-		});
-
 		return mainComposite;
 	}
 
@@ -473,7 +490,8 @@
 			URL testURL = new URL(urlText);
 			wsdlDefinition =
 				TesterWSDLUtils.readWSDLURL(testURL);
-			updateServiceCombo();
+			if (showServicePortOperaton)
+				updateServiceCombo();
 		} catch (MalformedURLException e) {
 			return StatusUtils.errorStatus(JBossWSUIMessages.WSDLBrowseDialog_Status_Invalid_URL, e);
 		} catch (WSDLException e) {
@@ -486,17 +504,21 @@
 	protected Control createContents(Composite parent) {
 		Control control = super.createContents(parent);
 
-		setGroupEnabled(false);
+		if (showServicePortOperaton)
+			setGroupEnabled(false);
 
 		if (WSDLBrowseDialog.wsdlTextValue != null) {
 			this.locationCombo.setText(wsdlTextValue);
 			IStatus status = validate();
 			if (status != Status.OK_STATUS) {
-				setGroupEnabled(false);
+				if (showServicePortOperaton)
+					setGroupEnabled(false);
 			} else {
-				setGroupEnabled(true);
+				if (showServicePortOperaton)
+					setGroupEnabled(true);
 			}
 		}
+		control.pack(true);
 		return control;
 	}
 	



More information about the jbosstools-commits mailing list