Search in sources :

Example 1 with NewRuntimeWizardFragment

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();
}
Also used : NewRuntimeWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment) WizardFragment(org.eclipse.wst.server.ui.wizard.WizardFragment) NewRuntimeWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TaskWizard(org.eclipse.wst.server.ui.internal.wizard.TaskWizard)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 TaskWizard (org.eclipse.wst.server.ui.internal.wizard.TaskWizard)1 NewRuntimeWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment)1 WizardFragment (org.eclipse.wst.server.ui.wizard.WizardFragment)1