/** * Return the server. * * @return the server */ public IServer getServer() { try { return (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER); } catch (Exception e) { return null; } }
public static void invalidateLicense(TaskModel taskModel) { IFeature is = (IFeature) taskModel.getObject(WizardTaskUtil.TASK_FEATURE); IFeature ls = (IFeature) taskModel.getObject(LicenseWizardFragment.LICENSE_SERVER); if (is == ls) return; taskModel.putObject(LicenseWizardFragment.LICENSE, LicenseWizardFragment.LICENSE_UNKNOWN); taskModel.putObject(LicenseWizardFragment.LICENSE_ACCEPT, null); taskModel.putObject(LicenseWizardFragment.LICENSE_SERVER, null); }
public void widgetSelected(SelectionEvent e) { taskModel.putObject(WizardTaskUtil.TASK_DEFAULT_SERVER, new Boolean(pref.getSelection())); } });
protected int showWizard(final IRuntimeWorkingCopy runtimeWorkingCopy) { String title = null; WizardFragment fragment = null; TaskModel taskModel = new TaskModel(); if (runtimeWorkingCopy == null) { title = Messages.wizNewRuntimeWizardTitle; return Window.CANCEL; taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy); fragment = new WizardFragment() { protected void createChildFragments(List list) {
/** * Create a new TaskWizard with the given title, root fragment, and task model. * * @param title a title * @param rootFragment a root fragment * @param taskModel a task model */ public TaskWizard(String title, WizardFragment rootFragment, TaskModel taskModel) { super(); if (title != null) setWindowTitle(title); this.rootFragment = rootFragment; this.taskModel = taskModel; if (taskModel == null) this.taskModel = new TaskModel(); setNeedsProgressMonitor(true); setForcePreviousAndNextButtons(true); }
protected void updateTaskModel() { if (taskModel != null) { IServerWorkingCopy server = getServer(); if (server != null) { taskModel.putObject(TaskModel.TASK_SERVER, server); taskModel.putObject(TaskModel.TASK_RUNTIME, server.getRuntime()); } else { taskModel.putObject(TaskModel.TASK_SERVER, null); taskModel.putObject(TaskModel.TASK_RUNTIME, null); } } wizard.update(); }
protected int showWizard(final IRuntimeWorkingCopy runtimeWorkingCopy) { String title = Messages.wizEditRuntimeWizardTitle; final WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(runtimeWorkingCopy.getRuntimeType().getId()); if (fragment2 == null) return Window.CANCEL; TaskModel taskModel = new TaskModel(); taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy); WizardFragment fragment = new WizardFragment() { protected void createChildFragments(List list) { list.add(fragment2); list.add(WizardTaskUtil.SaveRuntimeFragment); } }; TaskWizard wizard = new TaskWizard(title, fragment, taskModel); wizard.setForcePreviousAndNextButtons(true); ClosableWizardDialog dialog = new ClosableWizardDialog(getEditorSite().getShell(), wizard); return dialog.open(); }
/** * Return the launchable adapter. * * @return the adapter */ public ILaunchableAdapter getLaunchableAdapter() { try { return (ILaunchableAdapter) getTaskModel().getObject(WizardTaskUtil.TASK_LAUNCHABLE_ADAPTER); } catch (Exception e) { return null; } }
protected static void saveRuntime(TaskModel taskModel, IProgressMonitor monitor) throws CoreException { IRuntime runtime = (IRuntime) taskModel.getObject(TaskModel.TASK_RUNTIME); if (runtime != null && runtime instanceof IRuntimeWorkingCopy) { IRuntimeWorkingCopy workingCopy = (IRuntimeWorkingCopy) runtime; if (workingCopy.isDirty()) taskModel.putObject(TaskModel.TASK_RUNTIME, workingCopy.save(false, monitor)); } }
public void widgetSelected(SelectionEvent e) { accepted = accept.getSelection(); taskModel.putObject(LicenseWizardFragment.LICENSE_ACCEPT, new Boolean(accepted)); wizard.update(); } });
/** * Return the selected client. * * @return the client */ public IClient getSelectedClient() { try { return (IClient) getTaskModel().getObject(WizardTaskUtil.TASK_CLIENT); } catch (Exception e) { return null; } }
public void updateLicense() { String license = (String) taskModel.getObject(LicenseWizardFragment.LICENSE); if (license == null) license = LicenseWizardFragment.LICENSE_UNKNOWN; Object acc = taskModel.getObject(LicenseWizardFragment.LICENSE_ACCEPT); if (acc == null) { accepted = false; accept.setSelection(false); decline.setSelection(false); } if (LicenseWizardFragment.LICENSE_NONE.equals(license)) { licenseText.setText(Messages.wizLicenseNone); accept.setEnabled(false); decline.setEnabled(false); accepted = true; } else if (LicenseWizardFragment.LICENSE_UNKNOWN.equals(license)) { licenseText.setText(Messages.wizLicenseNone); accept.setEnabled(true); decline.setEnabled(true); } else { licenseText.setText(license); accept.setEnabled(true); decline.setEnabled(true); } taskModel.putObject(LicenseWizardFragment.LICENSE_ACCEPT, new Boolean(accepted)); } }
public void setTaskModel(TaskModel model) { taskModel = model; taskModel.putObject(WizardTaskUtil.TASK_MODE, new Byte(mode)); updateTaskModel(); }
public static void updateLicense(IWizardHandle wizard, final TaskModel taskModel) { final IFeature feature = (IFeature) taskModel.getObject(WizardTaskUtil.TASK_FEATURE); IFeature ls = (IFeature) taskModel.getObject(LicenseWizardFragment.LICENSE_SERVER); if (feature.equals(ls)) return; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { String license = LicenseWizardFragment.LICENSE_UNKNOWN; license = ExtensionUtility.getLicense(feature); if (license == null) license = LicenseWizardFragment.LICENSE_NONE; taskModel.putObject(LicenseWizardFragment.LICENSE, license); taskModel.putObject(LicenseWizardFragment.LICENSE_SERVER, feature); } }; try { wizard.run(true, false, runnable); } catch (Exception e) { Trace.trace(Trace.SEVERE, "Error with runnable", e); //$NON-NLS-1$ } }
protected static void tempSaveRuntime(TaskModel taskModel, IProgressMonitor monitor) throws CoreException { IRuntime runtime = (IRuntime) taskModel.getObject(TaskModel.TASK_RUNTIME); if (runtime != null && runtime instanceof IRuntimeWorkingCopy) { IRuntimeWorkingCopy workingCopy = (IRuntimeWorkingCopy) runtime; if (!workingCopy.isDirty()) return; runtime = workingCopy.save(false, monitor); taskModel.putObject(TaskModel.TASK_RUNTIME, runtime.createWorkingCopy()); } }
protected void handleServer() { boolean option = false; if (serverType != null && serverType.hasRuntime()) option = true; createServer.setVisible(option); if (option && createServer.getSelection()) { IServerWorkingCopy server = getServer(); taskModel.putObject(TaskModel.TASK_SERVER, server); } else taskModel.putObject(TaskModel.TASK_SERVER, null); taskModel.putObject(TaskModel.TASK_RUNTIME, runtime); wizard.update(); }
private IServerWorkingCopy getServer() { try { return (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER); } catch (Exception e) { return null; } } }
IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER); if (lastServer == null && server == null) return; getTaskModel().putObject(WizardTaskUtil.TASK_CLIENTS, null); getTaskModel().putObject(WizardTaskUtil.TASK_HAS_CLIENTS, new Boolean(false)); try { Object[] obj = ServerUIPlugin.getLaunchableAdapter(server, moduleArtifact); getTaskModel().putObject(WizardTaskUtil.TASK_LAUNCHABLE_ADAPTER, obj[0]); getTaskModel().putObject(WizardTaskUtil.TASK_LAUNCHABLE, obj[1]); launchable = obj[1]; } catch (CoreException ce) { getTaskModel().putObject(WizardTaskUtil.TASK_LAUNCHABLE_ADAPTER, null); getTaskModel().putObject(WizardTaskUtil.TASK_LAUNCHABLE, null); EclipseUtil.openError(null, ce.getStatus()); String launchMode = (String) getTaskModel().getObject(TaskModel.TASK_LAUNCH_MODE); clients = ServerUIPlugin.getClients(server, launchable, launchMode); getTaskModel().putObject(WizardTaskUtil.TASK_CLIENTS, clients); getTaskModel().putObject(WizardTaskUtil.TASK_HAS_CLIENTS, new Boolean(true)); } else getTaskModel().putObject(WizardTaskUtil.TASK_CLIENT, clients[0]);
public NewServerWizard(final String[] ids, final String[] values) { super(Messages.wizNewServerWizardTitle, new WizardFragment() { protected void createChildFragments(List list) { list.add(new NewServerWizardFragment()); 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); } }); if (ids != null) { TaskModel taskModel2 = getTaskModel(); int size = ids.length; for (int i = 0; i < size; i++) { taskModel2.putObject(ids[i], values[i]); } } }