use of org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment in project webtools.servertools by eclipse.
the class RuntimePreferencePage method showWizard.
protected int showWizard(final IRuntimeWorkingCopy runtimeWorkingCopy) {
String title = null;
WizardFragment fragment = null;
TaskModel taskModel = new TaskModel();
if (runtimeWorkingCopy == null) {
title = Messages.wizNewRuntimeWizardTitle;
fragment = new WizardFragment() {
protected void createChildFragments(List<WizardFragment> list) {
list.add(new NewRuntimeWizardFragment());
list.add(WizardTaskUtil.SaveRuntimeFragment);
}
};
} else {
title = Messages.wizEditRuntimeWizardTitle;
final WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(runtimeWorkingCopy.getRuntimeType().getId());
if (fragment2 == null) {
edit.setEnabled(false);
return Window.CANCEL;
}
taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy);
fragment = new WizardFragment() {
protected void createChildFragments(List<WizardFragment> list) {
list.add(fragment2);
list.add(WizardTaskUtil.SaveRuntimeFragment);
}
};
}
TaskWizard wizard = new TaskWizard(title, fragment, taskModel);
wizard.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
return dialog.open();
}
Aggregations