View | Details | Raw Unified | Return to bug 221232 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jst/ws/internal/consumption/ui/ConsumptionUIMessages.java (+2 lines)
Lines 30-35 Link Here
30
 * 20080326   171705 trungha@ca.ibm.com - Trung, improve AntTask errors report
30
 * 20080326   171705 trungha@ca.ibm.com - Trung, improve AntTask errors report
31
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
31
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
32
 * 20080416   215084 gilberta@ca.ibm.com - Gilbert Andrews
32
 * 20080416   215084 gilberta@ca.ibm.com - Gilbert Andrews
33
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
33
 *******************************************************************************/
34
 *******************************************************************************/
34
package org.eclipse.jst.ws.internal.consumption.ui;
35
package org.eclipse.jst.ws.internal.consumption.ui;
35
36
Lines 83-88 Link Here
83
	public static String LABEL_SUMMARY_NO_CLIENT;
84
	public static String LABEL_SUMMARY_NO_CLIENT;
84
	public static String LABEL_RUNTIMES_LIST;
85
	public static String LABEL_RUNTIMES_LIST;
85
	public static String LABEL_SERVERS_LIST;
86
	public static String LABEL_SERVERS_LIST;
87
	public static String LABEL_SERVERS_INSTANCES;
86
	public static String LABEL_EDIT_BUTTON;
88
	public static String LABEL_EDIT_BUTTON;
87
	public static String LABEL_SERVICE_EAR_MODULE;
89
	public static String LABEL_SERVICE_EAR_MODULE;
88
	public static String LABEL_CLIENT_EAR_MODULE;
90
	public static String LABEL_CLIENT_EAR_MODULE;
(-)src/org/eclipse/jst/ws/internal/consumption/ui/ConsumptionUI.properties (+2 lines)
Lines 32-37 Link Here
32
# 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
32
# 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
33
# 20080331   225032 makandre@ca.ibm.com - Andrew Mak, Error msg references renamed category
33
# 20080331   225032 makandre@ca.ibm.com - Andrew Mak, Error msg references renamed category
34
# 20080416   215084 gilberta@ca.ibm.com - Gilbert Andrews
34
# 20080416   215084 gilberta@ca.ibm.com - Gilbert Andrews
35
# 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
35
###############################################################################
36
###############################################################################
36
37
37
#
38
#
Lines 143-148 Link Here
143
PAGE_DESC_WS_RUNTIME_SELECTION=Choose from the list of runtimes and deployment servers, or use the default settings.
144
PAGE_DESC_WS_RUNTIME_SELECTION=Choose from the list of runtimes and deployment servers, or use the default settings.
144
LABEL_RUNTIMES_LIST=Web service runtime:
145
LABEL_RUNTIMES_LIST=Web service runtime:
145
LABEL_SERVERS_LIST=Server:
146
LABEL_SERVERS_LIST=Server:
147
LABEL_SERVERS_INSTANCES=Server Instance:
146
LABEL_EDIT_BUTTON=Edit...
148
LABEL_EDIT_BUTTON=Edit...
147
LABEL_SERVICE_EAR_MODULE=Service EAR module:
149
LABEL_SERVICE_EAR_MODULE=Service EAR module:
148
LABEL_CLIENT_EAR_MODULE=Client EAR module:
150
LABEL_CLIENT_EAR_MODULE=Client EAR module:
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java (-1 / +8 lines)
Lines 18-23 Link Here
18
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
18
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
19
 * 20080331   224953 gilberta@ca.ibm.com - Gilbert Andrews
19
 * 20080331   224953 gilberta@ca.ibm.com - Gilbert Andrews
20
 * 20080415   227237 gilberta@ca.ibm.com - Gilbert Andrews
20
 * 20080415   227237 gilberta@ca.ibm.com - Gilbert Andrews
21
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
21
 *******************************************************************************/
22
 *******************************************************************************/
22
package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
23
package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
23
24
Lines 154-159 Link Here
154
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class );
155
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class );
155
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class );
156
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class );
156
    dataRegistry.addMapping(InitializeProxyCommand.class, "TestFacility",ClientTestWidget.class);
157
    dataRegistry.addMapping(InitializeProxyCommand.class, "TestFacility",ClientTestWidget.class);
158
    dataRegistry.addMapping(InitializeProxyCommand.class, "Popup",ClientTestWidget.class);
157
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class);
159
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class);
158
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class);
160
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class);
159
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class);
161
    dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class);
Lines 169-174 Link Here
169
    dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class);
171
    dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class);
170
    dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class);
172
    dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class);
171
    dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class);
173
    dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class);
174
    dataRegistry.addMapping(ClientTestWidget.class, "ServerInstanceId", FinishDefaultCommand.class);
175
    dataRegistry.addMapping(ClientTestWidget.class, "ExistingServerId", FinishDefaultCommand.class);
172
  }
176
  }
173
177
174
  /* (non-Javadoc)
178
  /* (non-Javadoc)
Lines 278-284 Link Here
278
	  	return status;
282
	  	return status;
279
  	}
283
  	}
280
	
284
	
281
		
285
	public boolean getPopup(){
286
		return true;
287
	}
288
	
282
	public String getProxyBean()
289
	public String getProxyBean()
283
    {
290
    {
284
		String proxyBean = "";
291
		String proxyBean = "";
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java (-2 / +135 lines)
Lines 13-31 Link Here
13
 * 20060815   104870 makandre@ca.ibm.com - Andrew Mak, enable/disable test page controls base on settings in test facility extension
13
 * 20060815   104870 makandre@ca.ibm.com - Andrew Mak, enable/disable test page controls base on settings in test facility extension
14
 * 20060815   153903 makandre@ca.ibm.com - Andrew Mak, Browse does not work in generate client test page
14
 * 20060815   153903 makandre@ca.ibm.com - Andrew Mak, Browse does not work in generate client test page
15
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
15
 * 20080325   184761 gilberta@ca.ibm.com - Gilbert Andrews
16
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
16
 *******************************************************************************/
17
 *******************************************************************************/
17
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
18
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
18
19
20
import java.util.Set;
21
22
import org.eclipse.core.resources.IProject;
19
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.resources.IResource;
20
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.IPath;
22
import org.eclipse.core.runtime.IStatus;
26
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Path;
27
import org.eclipse.core.runtime.Path;
24
import org.eclipse.core.runtime.Status;
28
import org.eclipse.core.runtime.Status;
29
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
25
import org.eclipse.jface.viewers.IStructuredSelection;
30
import org.eclipse.jface.viewers.IStructuredSelection;
26
import org.eclipse.jst.ws.internal.common.ResourceUtils;
31
import org.eclipse.jst.ws.internal.common.ResourceUtils;
32
import org.eclipse.jst.ws.internal.common.ServerUtils;
33
import org.eclipse.jst.ws.internal.consumption.common.FacetUtils;
27
import org.eclipse.jst.ws.internal.consumption.common.FolderResourceFilter;
34
import org.eclipse.jst.ws.internal.consumption.common.FolderResourceFilter;
28
import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages;
35
import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages;
36
import org.eclipse.jst.ws.internal.consumption.ui.common.LabelsAndIds;
37
import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils;
29
import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
38
import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension;
30
import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
39
import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry;
31
import org.eclipse.jst.ws.internal.ui.common.UIUtils;
40
import org.eclipse.jst.ws.internal.ui.common.UIUtils;
Lines 52-57 Link Here
52
import org.eclipse.wst.command.internal.env.core.selection.SelectionList;
61
import org.eclipse.wst.command.internal.env.core.selection.SelectionList;
53
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor;
62
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor;
54
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
63
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
64
import org.eclipse.wst.server.core.IServer;
65
import org.eclipse.wst.server.core.IServerType;
66
import org.eclipse.wst.server.core.ServerCore;
55
67
56
68
57
public class ClientTestWidget extends SimpleWidgetDataContributor
69
public class ClientTestWidget extends SimpleWidgetDataContributor
Lines 68-73 Link Here
68
  private Combo testTypeCombo_;
80
  private Combo testTypeCombo_;
69
   /*CONTEXT_ID PWSM0003 for the Test Type Combo box of the Sample Page*/
81
   /*CONTEXT_ID PWSM0003 for the Test Type Combo box of the Sample Page*/
70
  private String INFOPOP_PWSM_COMBOBOX_TEST = "PWSM0003";
82
  private String INFOPOP_PWSM_COMBOBOX_TEST = "PWSM0003";
83
  
84
  private Combo serverTypeCombo_;
85
  /*CONTEXT_ID PWSM0003 for the Test Type Combo box of the Sample Page*/
86
  private String INFOPOP_PWSM_COMBOBOX_SERVER = "PWSM0003";
87
  
88
  private Combo serverInstanceTypeCombo_;
89
  /*CONTEXT_ID PWSM0003 for the Test Type Combo box of the Sample Page*/
90
  private String INFOPOP_PWSM_COMBOBOX_SERVER_INSTANCE = "PWSM0003";
71
91
72
  private Text  jspFolderText_;
92
  private Text  jspFolderText_;
73
  /*CONTEXT_ID PWSM0008 for the JSP Folder field of the Sample Page*/
93
  /*CONTEXT_ID PWSM0008 for the JSP Folder field of the Sample Page*/
Lines 108-120 Link Here
108
  private FolderResourceFilter folderFilter_ = new FolderResourceFilter();
128
  private FolderResourceFilter folderFilter_ = new FolderResourceFilter();
109
  private IStructuredSelection initialSelection_;
129
  private IStructuredSelection initialSelection_;
110
  private boolean isTestWidget = false;
130
  private boolean isTestWidget = false;
131
  private boolean isPopup = false;
132
  
133
  private LabelsAndIds serverTypes_;
134
  private LabelsAndIds serverInstances_;
111
  
135
  
112
  private IPath webContentPath_;
136
  private IPath webContentPath_;
113
  private IResource webContent_;
137
  private IResource webContent_;
114
    
138
    
115
  public WidgetDataEvents addControls( Composite parent, Listener statusListener )
139
  public WidgetDataEvents addControls( Composite parent, Listener statusListener )
116
  {
140
  {
117
    isTestWidget = true;
141
    
142
	  
143
	isTestWidget = true;
118
    UIUtils      uiUtils  = new UIUtils( pluginId_ );
144
    UIUtils      uiUtils  = new UIUtils( pluginId_ );
119
        
145
        
120
	parent.setToolTipText( ConsumptionUIMessages.TOOLTIP_PWSM_PAGE );
146
	parent.setToolTipText( ConsumptionUIMessages.TOOLTIP_PWSM_PAGE );
Lines 131-137 Link Here
131
                                          }
157
                                          }
132
                                        });
158
                                        });
133
    
159
    
134
    comboGroup_ = uiUtils.createComposite( parent, 3, 5, 0 );
160
    comboGroup_ = uiUtils.createComposite( parent, 3, 8, 0 );
135
    
161
    
136
    testTypeCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_TEST_TYPES,
162
    testTypeCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_TEST_TYPES,
137
    									ConsumptionUIMessages.TOOLTIP_PWSM_COMBOBOX_TEST,
163
    									ConsumptionUIMessages.TOOLTIP_PWSM_COMBOBOX_TEST,
Lines 145-150 Link Here
145
    		}
171
    		}
146
    );    
172
    );    
147
    
173
    
174
    
175
    
148
    new Label( comboGroup_, SWT.NONE );
176
    new Label( comboGroup_, SWT.NONE );
149
    
177
    
150
    projectCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_JSP_PROJECT_NAME,
178
    projectCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_JSP_PROJECT_NAME,
Lines 169-174 Link Here
169
                                            INFOPOP_PWSM_TEXT_SAMPLE_FOLDER,
197
                                            INFOPOP_PWSM_TEXT_SAMPLE_FOLDER,
170
                                            SWT.SINGLE | SWT.BORDER );
198
                                            SWT.SINGLE | SWT.BORDER );
171
    
199
    
200
    
201
    
172
    sampleFolderText_.addModifyListener( new ModifyListener()
202
    sampleFolderText_.addModifyListener( new ModifyListener()
173
        {
203
        {
174
        public void modifyText( ModifyEvent evt )
204
        public void modifyText( ModifyEvent evt )
Lines 195-200 Link Here
195
            SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
225
            SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
196
    jspFolderText_.setEnabled( false );
226
    jspFolderText_.setEnabled( false );
197
    
227
    
228
    new Label( comboGroup_, SWT.NONE );
229
    
198
    Group methodsGroup = uiUtils.createGroup( parent, ConsumptionUIMessages.LABEL_METHODS,  
230
    Group methodsGroup = uiUtils.createGroup( parent, ConsumptionUIMessages.LABEL_METHODS,  
199
    				ConsumptionUIMessages.TOOLTIP_PWSM_TREE_METHODS, null );
231
    				ConsumptionUIMessages.TOOLTIP_PWSM_TREE_METHODS, null );
200
    
232
    
Lines 350-355 Link Here
350
	}
382
	}
351
  } 
383
  } 
352
  
384
  
385
  private void handleServerChange()
386
  {
387
	  int selection = serverTypeCombo_.getSelectionIndex();
388
	  serverInstances_.clear();
389
	  serverInstanceTypeCombo_.removeAll();
390
	  IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
391
	  for(int j =0; j<servers.length;j++){
392
			String id = serverTypes_.getId(selection);
393
			if(id.equals(servers[j].getServerType().getId())){
394
				serverInstances_.add(servers[j].getId(), servers[j].getName());
395
				serverInstanceTypeCombo_.add(servers[j].getName());
396
			}
397
	  }
398
	  serverInstanceTypeCombo_.select(0);
399
	 
400
  } 
401
  
402
  private void handleServerInstance()
403
  {
404
	
405
  } 
406
  
353
  // Here are the getters and setters for this widget.
407
  // Here are the getters and setters for this widget.
354
  public void setTestService( Boolean testService )
408
  public void setTestService( Boolean testService )
355
  {
409
  {
Lines 399-404 Link Here
399
	  return project;
453
	  return project;
400
  }
454
  }
401
  
455
  
456
  public void initServersTypes() 
457
  {
458
	if(serverTypes_  == null)
459
		serverTypes_ = new LabelsAndIds();
460
	IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
461
	IServerType[] serverTypes = ServerCore.getServerTypes();
462
	ValidationUtils vu = new ValidationUtils();
463
	String projectName = projectCombo_.getText();
464
	Set projectFacets = FacetUtils.getFacetsForProject(projectName);
465
	for(int i = 0;i<serverTypes.length;i++){
466
		if(vu.doesServerSupportFacets(serverTypes[i].getId(), projectFacets)){
467
			serverTypes_.add(serverTypes[i].getId(), serverTypes[i].getName());
468
			serverTypeCombo_.add( serverTypes[i].getName() );
469
		}
470
		serverTypeCombo_.select(0);
471
	}
472
	if(serverInstances_  == null)
473
		serverInstances_ = new LabelsAndIds();
474
	for(int j =0; j<servers.length;j++){
475
		String id = serverTypes_.getId(0);
476
		if(id.equals(servers[j].getServerType().getId())){
477
			serverInstances_.add(servers[j].getId(), servers[j].getName());
478
			serverInstanceTypeCombo_.add(servers[j].getName());
479
		}
480
	}
481
	serverInstanceTypeCombo_.select(0);
482
	serverInstanceTypeCombo_.setEnabled(canRunTestClient_);
483
	serverTypeCombo_.setEnabled(canRunTestClient_);
484
  }
485
  
486
  
402
  public void setSampleProject(String clientProject) 
487
  public void setSampleProject(String clientProject) 
403
  {
488
  {
404
	projectCombo_.setItems( new String[]{ extractProjectName(clientProject) } );
489
	projectCombo_.setItems( new String[]{ extractProjectName(clientProject) } );
Lines 462-472 Link Here
462
	  runTestCheckbox_.setEnabled(false);
547
	  runTestCheckbox_.setEnabled(false);
463
  }
548
  }
464
  
549
  
550
  public void setPopup(boolean popup){
551
	  isPopup = popup;
552
	  if(isPopup){
553
		  UIUtils      uiUtils  = new UIUtils( pluginId_ );
554
		  serverTypeCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_SERVERS_LIST,
555
					ConsumptionUIMessages.TOOLTIP_PWSM_COMBOBOX_TEST,
556
		              INFOPOP_PWSM_COMBOBOX_TEST,
557
		              SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
558
		    	serverTypeCombo_.addSelectionListener(
559
		    		new SelectionAdapter() {
560
		    			public void widgetSelected(SelectionEvent e) {
561
		    				handleServerChange();
562
		    			}
563
		    		}
564
		    	);    
565
		    
566
		  new Label( comboGroup_, SWT.NONE );
567
		
568
	  
569
		  serverInstanceTypeCombo_ = uiUtils.createCombo( comboGroup_, ConsumptionUIMessages.LABEL_SERVERS_INSTANCES,
570
					ConsumptionUIMessages.TOOLTIP_PWSM_COMBOBOX_TEST,
571
		              INFOPOP_PWSM_COMBOBOX_TEST,
572
		              SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
573
		  serverInstanceTypeCombo_.addSelectionListener(
574
		    		new SelectionAdapter() {
575
		    			public void widgetSelected(SelectionEvent e) {
576
		    				handleServerInstance();
577
		    			}
578
		    		}
579
		    	);    
580
		    
581
		  new Label( comboGroup_, SWT.NONE );
582
		  initServersTypes();
583
	  
584
	  }
585
  }
586
  
465
  public boolean getCanRunTestClient()
587
  public boolean getCanRunTestClient()
466
  {
588
  {
467
	  return canRunTestClient_;
589
	  return canRunTestClient_;
468
  }
590
  }
469
  
591
  
592
  public String getServerInstanceId(){
593
	  int instanceLabel = serverInstanceTypeCombo_.getSelectionIndex();
594
	  if(instanceLabel == -1) return null;
595
	  return serverInstances_.getId(instanceLabel);
596
  }
597
  
598
  public String getExistingServerId(){
599
	  int instanceLabel = serverTypeCombo_.getSelectionIndex();
600
	  return serverTypes_.getId(instanceLabel);
601
  }
602
  
470
  public BooleanSelection[] getMethods()
603
  public BooleanSelection[] getMethods()
471
  {
604
  {
472
    TreeItem[]         items   = methodsTree_.getItems();
605
    TreeItem[]         items   = methodsTree_.getItems();
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/FinishDefaultCommand.java (-5 / +17 lines)
Lines 1-12 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 * IBM Corporation - initial API and implementation
10
 * yyyymmdd bug      Email and other contact information
11
 * -------- -------- -----------------------------------------------------------
12
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
10
 *******************************************************************************/
13
 *******************************************************************************/
11
14
12
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
15
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
Lines 15-20 Link Here
15
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.core.runtime.Status;
20
import org.eclipse.core.runtime.Status;
21
import org.eclipse.jst.ws.internal.consumption.command.common.CreateServerCommand;
18
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
22
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
19
import org.eclipse.wst.server.core.IServer;
23
import org.eclipse.wst.server.core.IServer;
20
import org.eclipse.wst.server.core.ServerCore;
24
import org.eclipse.wst.server.core.ServerCore;
Lines 42-50 Link Here
42
  	IStatus status = Status.OK_STATUS;
46
  	IStatus status = Status.OK_STATUS;
43
  	if(sampleServerInstanceId != null){
47
  	if(sampleServerInstanceId != null){
44
  	  sampleExistingServer = ServerCore.findServer(sampleServerInstanceId);
48
  	  sampleExistingServer = ServerCore.findServer(sampleServerInstanceId);
45
  	if (sampleExistingServer != null)
49
  	  if (sampleExistingServer != null)
46
      sampleServerTypeID = sampleExistingServer.getServerType().getId();
50
  		  sampleServerTypeID = sampleExistingServer.getServerType().getId();
47
      
51
    }
52
  	else if(sampleServerTypeID != null){
53
  		CreateServerCommand createServer = new CreateServerCommand();
54
  		createServer.setServerFactoryid(sampleServerTypeID);
55
  		createServer.execute(monitor, adaptable);
56
  		sampleServerInstanceId = createServer.getServerInstanceId();
57
  		sampleExistingServer = ServerCore.findServer(sampleServerInstanceId);
58
  	
48
  	}
59
  	}
49
    return status;
60
    return status;
50
  
61
  
Lines 68-73 Link Here
68
79
69
  public void setExistingServerId(String existingServerId)
80
  public void setExistingServerId(String existingServerId)
70
  {
81
  {
82
	  sampleServerTypeID=existingServerId;
71
  }  
83
  }  
72
84
73
}
85
}
(-)src/org/eclipse/jst/ws/internal/consumption/ui/common/LabelsAndIds.java (+58 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 * IBM Corporation - initial API and implementation
10
 * yyyymmdd bug      Email and other contact information
11
 * -------- -------- -----------------------------------------------------------
12
 * 20080221 146023 gilberta@ca.ibm.com - Gilbert Andrews 
13
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
14
 *******************************************************************************/
15
/**
16
 */
17
package org.eclipse.jst.ws.internal.consumption.ui.common;
18
19
import java.util.Vector;
20
21
public class LabelsAndIds
22
{
23
  private Vector labels_ = new Vector();
24
  private Vector ids_ = new Vector();
25
  
26
  
27
  public void add(String id, String label){
28
	  ids_.add(id);
29
	  labels_.add(label);
30
  }
31
  
32
  public String getId(int index){
33
	  return (String)ids_.get(index);
34
  }
35
  
36
  public void clear(){
37
	  labels_.clear();
38
	  ids_.clear();
39
  }
40
  
41
  /**
42
   * @return Returns the ids_.
43
   */
44
  public String[] getIds()
45
  {
46
	  String[] stringArray = new String[ids_.size()]; 
47
	  ids_.copyInto(stringArray);
48
	  return stringArray;
49
  }
50
  
51
  public String[] getLabels()
52
  {
53
	  String[] stringArray = new String[ids_.size()]; 
54
	  labels_.copyInto(stringArray);
55
	  return stringArray;
56
  }
57
  
58
}

Return to bug 221232