protected void createActions() { List actionList = new ArrayList(); // add server actions if (server != null && server.getServerType() != null) { Iterator iterator = ServerEditorCore.getServerEditorActionFactories().iterator(); String id = server.getServerType().getId(); while (iterator.hasNext()) { ServerEditorActionFactory factory = (ServerEditorActionFactory) iterator.next(); if (factory.supportsServerElementType(id) && factory.shouldDisplay(server)) actionList.add(factory.createAction(getEditorSite(), editorPartInput)); } } editorActions = new IAction[actionList.size()]; actionList.toArray(editorActions); }
if (pageFactory.supportsInsertionId(insertionId)) { String serverTypeId = null; if (server != null && server.getServerType() != null) serverTypeId = server.getServerType().getId(); if (serverTypeId != null && factory.supportsType(serverTypeId) && factory.shouldCreateSection(server)) {
protected void updateRuntimeCombo() { IRuntimeType runtimeType = server.getServerType().getRuntimeType(); runtimes = ServerUIPlugin.getRuntimes(runtimeType); if (SocketUtil.isLocalhost(server.getHost()) && runtimes != null) { List runtimes2 = new ArrayList(); int size = runtimes.length; for (int i = 0; i < size; i++) { IRuntime runtime2 = runtimes[i]; if (!runtime2.isStub()) runtimes2.add(runtime2); } runtimes = new IRuntime[runtimes2.size()]; runtimes2.toArray(runtimes); } int size = runtimes.length; String[] items = new String[size]; for (int i = 0; i < size; i++) items[i] = runtimes[i].getName(); runtimeCombo.setItems(items); }
protected void validate() { if (server != null && server.getServerType() != null && server.getServerType().hasServerConfiguration()) { IFolder folder = getServer().getServerConfiguration(); if (folder == null || !folder.exists()) { setErrorMessage(Messages.errorMissingConfiguration); return; } } if (autoPublishTime != null && autoPublishTime.isEnabled() && autoPublishOverride.getSelection()) { int i = autoPublishTime.getSelection(); if (i < 1) { setErrorMessage(NLS.bind(Messages.serverEditorOverviewAutoPublishInvalid, "1")); return; } } setErrorMessage(null); }
IServerWorkingCopy server = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER); if (server != null) { if (server.getServerType().hasServerConfiguration() && server instanceof ServerWorkingCopy) { ServerWorkingCopy swc = (ServerWorkingCopy) server; try { sub = getWizardFragment(server.getServerType().getId()); if (sub != null) list.add(sub);
if (server != null && server.getServerType() != null) serverTypeId = server.getServerType().getId();
if (server != null && server.getServerType() != null && server.getServerType().hasRuntime()) { final IRuntime runtime = server.getRuntime(); createLabel(toolkit, composite, Messages.serverEditorOverviewRuntime); IRuntimeType runtimeType = server.getServerType().getRuntimeType(); runtimes = ServerUIPlugin.getRuntimes(runtimeType); if (server != null && server.getServerType() != null && server.getServerType().hasServerConfiguration()) { createLabel(toolkit, composite, Messages.serverEditorOverviewServerConfigurationPath); if (server != null && server.getServerType() != null) { IServerType serverType = server.getServerType(); if (serverType.supportsLaunchMode(ILaunchManager.RUN_MODE) || serverType.supportsLaunchMode(ILaunchManager.DEBUG_MODE) || serverType.supportsLaunchMode(ILaunchManager.PROFILE_MODE)) {
setRuntime(getDefaultRuntime()); if (server.getServerType() != null && server.getServerType().hasServerConfiguration() && !runtime.getLocation().isEmpty()) ((ServerWorkingCopy)server).importRuntimeConfiguration(runtime, null);
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); } }