Search in sources :

Example 21 with WizardFragment

use of org.eclipse.wst.server.ui.wizard.WizardFragment in project webtools.servertools by eclipse.

the class NewRuntimeComposite method showDownloadableServerWizard.

protected boolean showDownloadableServerWizard(RuntimeTypeWithServerProxy runtimeType, IProgressMonitor monitor) {
    Display.getDefault().asyncExec(new Runnable() {

        public void run() {
            wizard.setMessage(Messages.downLoadableAdapterDescription, IMessageProvider.INFORMATION);
        }
    });
    serverType = runtimeType.getServerTypeProxy();
    WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(serverType.getRuntimeType().getId());
    if (fragment2 == null)
        return false;
    TaskModel fragmentTaskModel = fragment2.getTaskModel();
    if (fragmentTaskModel == null)
        fragmentTaskModel = new TaskModel();
    fragmentTaskModel.putObject(TaskModel.TASK_EXTENSION, runtimeType.getServerTypeProxy().getExtension());
    fragmentTaskModel.putObject(TaskModel.TASK_RUNTIME, serverType.getRuntimeType());
    fragmentTaskModel.putObject(TaskModel.TASK_SERVER, serverType);
    fragment2.setTaskModel(fragmentTaskModel);
    return true;
}
Also used : WizardFragment(org.eclipse.wst.server.ui.wizard.WizardFragment) LicenseWizardFragment(org.eclipse.wst.server.ui.internal.wizard.fragment.LicenseWizardFragment)

Example 22 with WizardFragment

use of org.eclipse.wst.server.ui.wizard.WizardFragment 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

WizardFragment (org.eclipse.wst.server.ui.wizard.WizardFragment)22 WizardDialog (org.eclipse.jface.wizard.WizardDialog)9 TaskWizard (org.eclipse.wst.server.ui.internal.wizard.TaskWizard)9 LicenseWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.LicenseWizardFragment)7 DownloadableAdapterLicenseWizardFragment (org.eclipse.wst.server.ui.internal.wizard.fragment.DownloadableAdapterLicenseWizardFragment)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)5 List (java.util.List)5 CoreException (org.eclipse.core.runtime.CoreException)5 ArrayList (java.util.ArrayList)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)3 TaskModel (org.eclipse.wst.server.core.TaskModel)3 Job (org.eclipse.core.runtime.jobs.Job)2 File (java.io.File)1 IOException (java.io.IOException)1 IWorkspaceRunnable (org.eclipse.core.resources.IWorkspaceRunnable)1 IPath (org.eclipse.core.runtime.IPath)1 IStatus (org.eclipse.core.runtime.IStatus)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1