/** * Return the selected client. * * @return the client */ public IClient getSelectedClient() { try { return (IClient) getTaskModel().getObject(WizardTaskUtil.TASK_CLIENT); } catch (Exception e) { return null; } }
/** * Return the server. * * @return the server */ public IServer getServer() { try { return (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER); } catch (Exception e) { return null; } }
/** * Return the launchable adapter. * * @return the adapter */ public ILaunchableAdapter getLaunchableAdapter() { try { return (ILaunchableAdapter) getTaskModel().getObject(WizardTaskUtil.TASK_LAUNCHABLE_ADAPTER); } catch (Exception e) { return null; } }
private IServerWorkingCopy getServer() { try { return (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER); } catch (Exception e) { return null; } } }
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$ } }
public boolean isComplete() { try { Boolean b = (Boolean) getTaskModel().getObject(LicenseWizardFragment.LICENSE_ACCEPT); if (b != null && b.booleanValue()) return true; } catch (Exception e) { // ignore } return false; } }
/** * Return if the user wants to use the server as a default. * * @return true if the server should be the default */ public boolean isPreferredServer() { try { Boolean b = (Boolean) getTaskModel().getObject(WizardTaskUtil.TASK_DEFAULT_SERVER); return b.booleanValue(); } catch (Exception e) { return false; } }
/** * Return <code>true</code> if this wizard has multiple clients to show. * * @return <code>true</code> if this wizard has multiple clients, and <code>false</code> * otherwise */ protected boolean hasClients() { try { Boolean b = (Boolean) getTaskModel().getObject(WizardTaskUtil.TASK_HAS_CLIENTS); return b.booleanValue(); } catch (Exception e) { return false; } } }
/** * Return <code>true</code> if this wizard has tasks. * * @return <code>true</code> if this wizard has tasks, and <code>false</code> * otherwise */ protected boolean hasTasks() { try { Boolean b = (Boolean) getTaskModel().getObject(WizardTaskUtil.TASK_HAS_TASKS); return b.booleanValue(); } catch (Exception e) { return false; } }
public boolean isComplete() { return getTaskModel().getObject(WizardTaskUtil.TASK_FEATURE) != 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); }
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 performFinish(IProgressMonitor monitor) throws CoreException { try { IServerAttributes server2 = (IServerAttributes) getTaskModel().getObject(TaskModel.TASK_SERVER); ServerUIPlugin.getPreferences().addHostname(server2.getHost()); } catch (Exception e) { // ignore } } };
@Override public void performFinish(IProgressMonitor monitor) throws CoreException { IServer server = (IServer) getTaskModel().getObject(TaskModel.TASK_SERVER); if (server instanceof IServerWorkingCopy) { IServerWorkingCopy wc = (IServerWorkingCopy) server; wc.setAttribute(ISlingLaunchpadServer.PROP_PORT, DefaultCQLaunchpadConfiguration.INSTANCE.getPort()); wc.save(true, monitor); } } }
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()); } }
public Composite createComposite(Composite parent, IWizardHandle wizard) { String launchMode = (String) getTaskModel().getObject(TaskModel.TASK_LAUNCH_MODE); NewServerComposite comp = null; if (moduleType != null || serverTypeId != null) comp = new NewServerComposite(parent, wizard, moduleType, serverTypeId, launchMode); else comp = new NewServerComposite(parent, wizard, module, launchMode); if (getTaskModel() != null) comp.setTaskModel(getTaskModel()); return comp; }
/** * Create a new SelectClientComposite. * * @param parent a parent composite * @param wizard a wizard handle * @param taskModel a task model */ public SelectClientComposite(Composite parent, IWizardHandle wizard, TaskModel taskModel) { super(parent, SWT.NONE); this.wizard = wizard; this.taskModel = taskModel; try { clients = (IClient[]) taskModel.getObject(WizardTaskUtil.TASK_CLIENTS); } catch (Exception e) { // ignore } wizard.setTitle(Messages.wizSelectClientTitle); wizard.setDescription(Messages.wizSelectClientDescription); wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_SELECT_SERVER_CLIENT)); createControl(); }
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)); } } }