Community
Participate
Working Groups
In the new Server Wizard, adding a new runtime (which opens the runtime wizard) should automatically select the new runtime. Patch pasted below: ### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.server.ui Index: serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java =================================================================== RCS file: /cvsroot/webtools/servertools/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java,v retrieving revision 1.41 diff -u -r1.41 NewManualServerComposite.java --- serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java 21 Jul 2008 14:50:08 -0000 1.41 +++ serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java 3 Sep 2008 21:09:09 -0000 @@ -234,8 +234,7 @@ addRuntime.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { IServerType serverType = serverTypeComposite.getSelectedServerType(); - if (showRuntimeWizard(serverType) != Window.CANCEL) - updateRuntimeCombo(serverType); + showRuntimeWizard(serverType); } }); @@ -263,20 +262,20 @@ return (dialog.open() == Window.OK); } - protected int showRuntimeWizard(IServerType serverType) { + protected void showRuntimeWizard(IServerType serverType) { WizardFragment fragment = null; TaskModel taskModel = new TaskModel(); IRuntimeType runtimeType = serverType.getRuntimeType(); final WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(runtimeType.getId()); if (fragment2 == null) - return Window.CANCEL; + return; try { IRuntimeWorkingCopy runtimeWorkingCopy = runtimeType.createRuntime(null, null); taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy); } catch (CoreException ce) { Trace.trace(Trace.SEVERE, "Error creating runtime", ce); - return Window.CANCEL; + return; } fragment = new WizardFragment() { protected void createChildFragments(List<WizardFragment> list) { @@ -287,7 +286,13 @@ TaskWizard wizard2 = new TaskWizard(Messages.wizNewRuntimeWizardTitle, fragment, taskModel); wizard2.setForcePreviousAndNextButtons(true); WizardDialog dialog = new WizardDialog(getShell(), wizard2); - return dialog.open(); + if( dialog.open() != Window.CANCEL ) { + updateRuntimeCombo(serverType); + IRuntime rt = (IRuntime)taskModel.getObject(TaskModel.TASK_RUNTIME); + if( rt != null && rt.getName() != null && runtimeCombo.indexOf(rt.getName()) != -1) { + runtimeCombo.select(runtimeCombo.indexOf(rt.getName())); + } + } } public void setHost(String host) {
Created attachment 112350 [details] When a new runtime is created, it is automatically selected Ignore the pasted patch above and use the new attached one. The difference between the two is that the first correctly selected the right place in the combo but did not setRuntime(etc) properly.
Thanks for attaching the patch, I will release to 3.1 M3. I'm going to leave the return value of the method intact (personal preference, I prefer to leave a return value so a potential caller can still tell if the dialog was canceled) but otherwise directly apply the patch.
Fix released to 3.1 builds.
Closing old bugs.
New Gerrit change created: https://git.eclipse.org/r/108673