Search in sources :

Example 1 with NewServerWizardFragment

use of org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment in project jbosstools-openshift by jbosstools.

the class LaunchCDKServerHandler method showNewServerWizard.

/**
 * Open the new server wizard.
 *
 * @param shell a shell
 * @param serverTypeId a server runtime type, or null for any type
 * @return <code>true</code> if a server was created, or
 *    <code>false</code> otherwise
 */
public static IServer showNewServerWizard(Shell shell, final String serverTypeId) {
    WizardFragment fragment = new WizardFragment() {

        @Override
        protected void createChildFragments(List<WizardFragment> list) {
            list.add(new NewServerWizardFragment(null, serverTypeId));
            list.add(WizardTaskUtil.TempSaveRuntimeFragment);
            list.add(WizardTaskUtil.TempSaveServerFragment);
            list.add(new ModifyModulesWizardFragment());
            list.add(new TasksWizardFragment());
            list.add(WizardTaskUtil.SaveRuntimeFragment);
            list.add(WizardTaskUtil.SaveServerFragment);
            list.add(WizardTaskUtil.SaveHostnameFragment);
        }
    };
    TaskWizard wizard = new TaskWizard(Messages.wizNewServerWizardTitle, fragment);
    wizard.setForcePreviousAndNextButtons(true);
    WizardDialog dialog = new WizardDialog(shell, wizard);
    int ret = (dialog.open());
    if (ret == IDialogConstants.OK_ID) {
        IServer server = (IServer) wizard.getTaskModel().getObject(TaskModel.TASK_SERVER);
        return server;
    }
    return null;
}
Also used : NewServerWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment) TasksWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment) ModifyModulesWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment) WizardFragment(org.eclipse.wst.server.ui.wizard.WizardFragment) IServer(org.eclipse.wst.server.core.IServer) NewServerWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment) ModifyModulesWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment) TasksWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment) ArrayList(java.util.ArrayList) List(java.util.List) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TaskWizard(org.eclipse.wst.server.ui.internal.wizard.TaskWizard)

Example 2 with NewServerWizardFragment

use of org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment in project jbosstools-openshift by jbosstools.

the class LaunchCDKServerHandler method showNewServerWizard.

/**
 * Open the new server wizard.
 *
 * @param shell a shell
 * @param serverTypeId a server runtime type, or null for any type
 * @return <code>true</code> if a server was created, or
 *    <code>false</code> otherwise
 */
public static IServer showNewServerWizard(Shell shell, final String serverTypeId) {
    WizardFragment fragment = new WizardFragment() {

        @Override
        protected void createChildFragments(List<WizardFragment> list) {
            list.add(new NewServerWizardFragment(null, serverTypeId));
            list.add(WizardTaskUtil.TempSaveRuntimeFragment);
            list.add(WizardTaskUtil.TempSaveServerFragment);
            list.add(new ModifyModulesWizardFragment());
            list.add(new TasksWizardFragment());
            list.add(WizardTaskUtil.SaveRuntimeFragment);
            list.add(WizardTaskUtil.SaveServerFragment);
            list.add(WizardTaskUtil.SaveHostnameFragment);
        }
    };
    TaskWizard wizard = new TaskWizard(Messages.wizNewServerWizardTitle, fragment);
    wizard.setForcePreviousAndNextButtons(true);
    WizardDialog dialog = new WizardDialog(shell, wizard);
    int ret = (dialog.open());
    if (ret == IDialogConstants.OK_ID) {
        IServer server = (IServer) wizard.getTaskModel().getObject(TaskModel.TASK_SERVER);
        return server;
    }
    return null;
}
Also used : NewServerWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment) TasksWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment) ModifyModulesWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment) WizardFragment(org.eclipse.wst.server.ui.wizard.WizardFragment) IServer(org.eclipse.wst.server.core.IServer) NewServerWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment) ModifyModulesWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment) TasksWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment) ArrayList(java.util.ArrayList) List(java.util.List) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TaskWizard(org.eclipse.wst.server.ui.internal.wizard.TaskWizard)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 WizardDialog (org.eclipse.jface.wizard.WizardDialog)2 IServer (org.eclipse.wst.server.core.IServer)2 TaskWizard (org.eclipse.wst.server.ui.internal.wizard.TaskWizard)2 ModifyModulesWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment)2 NewServerWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment)2 TasksWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment)2 WizardFragment (org.eclipse.wst.server.ui.wizard.WizardFragment)2