public void widgetSelected(SelectionEvent e) { taskModel.putObject(WizardTaskUtil.TASK_DEFAULT_SERVER, new Boolean(pref.getSelection())); } });
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); }
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(); }
public void widgetSelected(SelectionEvent e) { accepted = accept.getSelection(); taskModel.putObject(LicenseWizardFragment.LICENSE_ACCEPT, new Boolean(accepted)); wizard.update(); } });
public void setTaskModel(TaskModel model) { taskModel = model; taskModel.putObject(WizardTaskUtil.TASK_MODE, new Byte(mode)); updateTaskModel(); }
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(); }
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]); } } }
protected void handleSelection(IFeature feature) { taskModel.putObject(WizardTaskUtil.TASK_FEATURE, feature); ExtensionWizard.invalidateLicense(taskModel); wizard.update(); } }
protected void updateTaskModel() { if (taskModel == null) return; taskModel.putObject(TaskModel.TASK_MODULES, getModuleMap()); wizard.update(); }
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)); } }
/** * ModifyModulesWizard constructor. * * @param server a server */ public ModifyModulesWizard(IServer server) { super(Messages.wizModuleWizardTitle, new ModifyModulesWizard2()); if (server != null) getTaskModel().putObject(TaskModel.TASK_SERVER, server.createWorkingCopy()); } }
/** * RunOnServerWizard constructor comment. * * @param server a server * @param launchMode a launch mode * @param moduleArtifact a module artifact */ public RunOnServerWizard(IServer server, String launchMode, IModuleArtifact moduleArtifact) { super(Messages.wizRunOnServerTitle, new RunOnServerWizardFragment(server, launchMode, moduleArtifact)); setNeedsProgressMonitor(true); if (ILaunchManager.DEBUG_MODE.equals(launchMode)) setWindowTitle(Messages.wizDebugOnServerTitle); else if (ILaunchManager.PROFILE_MODE.equals(launchMode)) setWindowTitle(Messages.wizProfileOnServerTitle); getTaskModel().putObject(TaskModel.TASK_SERVER, server); getTaskModel().putObject(TaskModel.TASK_LAUNCH_MODE, launchMode); addPages(); }
/** * RunOnServerWizard constructor comment. * * @param module a module * @param launchMode a launch mode * @param moduleArtifact a module artifact */ public RunOnServerWizard(IModule module, String launchMode, IModuleArtifact moduleArtifact) { super(Messages.wizRunOnServerTitle, new RunOnServerWizardFragment(module, launchMode, moduleArtifact)); setNeedsProgressMonitor(true); if (ILaunchManager.DEBUG_MODE.equals(launchMode)) setWindowTitle(Messages.wizDebugOnServerTitle); else if (ILaunchManager.PROFILE_MODE.equals(launchMode)) setWindowTitle(Messages.wizProfileOnServerTitle); getTaskModel().putObject(TaskModel.TASK_LAUNCH_MODE, launchMode); }
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()); } }
/** * Handle the selection of a client. */ protected void handleSelection() { int index = elementTable.getSelectionIndex(); if (index < 0) selectedClient = null; else selectedClient = clients[index]; taskModel.putObject(WizardTaskUtil.TASK_CLIENT, selectedClient); if (selectedClient != null) wizard.setMessage(null, IMessageProvider.NONE); else wizard.setMessage("", IMessageProvider.ERROR); String desc = null; if (selectedClient != null) desc = selectedClient.getDescription(); if (desc == null) desc = ""; description.setText(desc); wizard.update(); } }
public static void addModule(IModule module, TaskModel taskModel, IProgressMonitor monitor) throws CoreException { if (module == null) return; IServer server = (IServer) taskModel.getObject(TaskModel.TASK_SERVER); IModule parentModule = null; try { IModule[] parents = server.getRootModules(module, monitor); if (parents != null && parents.length > 0) parentModule = parents[0]; } catch (Exception e) { Trace.trace(Trace.WARNING, "Could not find parent module", e); } if (parentModule == null) { // use the original module since no parent module is available parentModule = module; } IModule[] modules = server.getModules(); int size = modules.length; for (int i = 0; i < size; i++) { if (parentModule.equals(modules[i])) return; } IServerWorkingCopy workingCopy = server.createWorkingCopy(); workingCopy.modifyModules(new IModule[] { parentModule }, new IModule[0], monitor); taskModel.putObject(TaskModel.TASK_SERVER, workingCopy.save(false, monitor)); }
protected void toggleMode(byte newMode) { if (!isVisible()) return; if (newMode == mode) return; mode = newMode; wizard.setMessage(null, IMessageProvider.NONE); if (mode == MODE_EXISTING) { stackLayout.topControl = existingComp; existingComp.setSelection(existingComp.getSelectedServer()); } else if (mode == MODE_DETECT) { stackLayout.topControl = detectComp2; detectComp.setVisible(true); } else { stackLayout.topControl = manualComp2; manualComp.setVisible(true); } stack.layout(); if (taskModel != null) { taskModel.putObject(WizardTaskUtil.TASK_MODE, new Byte(mode)); updateTaskModel(); } }
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(); }
protected static void saveServer(TaskModel taskModel, IProgressMonitor monitor) throws CoreException { IServer server = (IServer) taskModel.getObject(TaskModel.TASK_SERVER); if (server != null && server instanceof IServerWorkingCopy) { IServerWorkingCopy workingCopy = (IServerWorkingCopy) server; if (workingCopy.isDirty()) { IFile file = ((Server)workingCopy).getFile(); if (file != null) { IProject project = file.getProject(); if (!file.getProject().exists()) EclipseUtil.createNewServerProject(null, project.getName(), null, monitor); ProjectProperties pp = ServerPlugin.getProjectProperties(project); if (!pp.isServerProject()) pp.setServerProject(true, monitor); } taskModel.putObject(TaskModel.TASK_SERVER, workingCopy.save(false, monitor)); } } }
protected static void tempSaveServer(TaskModel taskModel, IProgressMonitor monitor) throws CoreException { IServer server = (IServer) taskModel.getObject(TaskModel.TASK_SERVER); if (server != null && server instanceof IServerWorkingCopy) { IServerWorkingCopy workingCopy = (IServerWorkingCopy) server; if (!workingCopy.isDirty()) return; IFile file = ((Server)workingCopy).getFile(); if (file != null) { IProject project = file.getProject(); if (!file.getProject().exists()) EclipseUtil.createNewServerProject(null, project.getName(), null, monitor); ProjectProperties pp = ServerPlugin.getProjectProperties(project); if (!pp.isServerProject()) pp.setServerProject(true, monitor); } IRuntime runtime = workingCopy.getRuntime(); server = workingCopy.save(false, monitor); workingCopy = server.createWorkingCopy(); workingCopy.setRuntime(runtime); if (workingCopy.getServerType().hasServerConfiguration()) ((ServerWorkingCopy)workingCopy).importRuntimeConfiguration(runtime, null); taskModel.putObject(TaskModel.TASK_SERVER, workingCopy); } }