/** * */ protected Image getImageImpl(Object element) { IRuntimeType runtimeType = (IRuntimeType) element; return ImageResource.getImage(runtimeType.getId()); }
public void runtimeFound(IRuntimeWorkingCopy runtime) { String runtimeTypeId = runtime.getRuntimeType().getId(); String serverTypeId = runtimeTypeId.substring(0, runtimeTypeId.length() - 8); IServerType serverType = ServerCore.findServerType(serverTypeId); try { IServerWorkingCopy server = serverType.createServer(serverTypeId, null, runtime, monitor); listener.serverFound(server); } catch (Exception e) { Trace.trace(Trace.WARNING, "Could not create Tomcat server", e); } } };
public ITomcatVersionHandler getVersionHandler() { IRuntimeType type = getRuntime().getRuntimeType(); return TomcatPlugin.getTomcatVersionHandler(type.getId()); }
/** * @see RuntimeDelegate#setDefaults(IProgressMonitor) */ public void setDefaults(IProgressMonitor monitor) { IRuntimeType type = getRuntimeWorkingCopy().getRuntimeType(); getRuntimeWorkingCopy().setLocation(new Path(TomcatPlugin.getPreference("location" + type.getId()))); }
/** * @see ITableLabelProvider#getColumnImage(Object, int) */ public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 0) { IRuntime runtime = (IRuntime) element; IRuntimeType runtimeType = runtime.getRuntimeType(); if (runtimeType != null) { Image image = ImageResource.getImage(runtimeType.getId()); if (decorator != null) { Image dec = decorator.decorateImage(image, element); if (dec != null) return dec; } return image; } } return null; }
/** * */ protected Image getImageImpl(Object element) { IRuntime runtime = (IRuntime) element; IRuntimeType runtimeType = runtime.getRuntimeType(); if (runtimeType != null) { Image image = ImageResource.getImage(runtimeType.getId()); if (decorator != null) { Image dec = decorator.decorateImage(image, element); if (dec != null) return dec; } return image; } return null; }
/** * @see RuntimeClasspathProviderDelegate#resolveClasspathContainer(IProject, IRuntime) */ public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) { IPath installPath = runtime.getLocation(); if (installPath == null) return new IClasspathEntry[0]; List list = new ArrayList(); String runtimeId = runtime.getRuntimeType().getId(); if (runtimeId.indexOf("32") > 0) { IPath path = installPath.append("lib"); addLibraryEntries(list, path.toFile(), true); } else if (runtimeId.indexOf("60") > 0) { // TODO May need some flexibility in case the installation has been configured differently // This lib "simplification" may cause issues for some. // Not known yet whether packaged Linux installs will go along. IPath path = installPath.append("lib"); addLibraryEntries(list, path.toFile(), true); } else { IPath path = installPath.append("common"); addLibraryEntries(list, path.append("lib").toFile(), true); addLibraryEntries(list, path.append("endorsed").toFile(), true); } return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]); } }
private IStatus doesProjectTargetMatchServerType(IProject p, String serverFactoryId) { if (p!=null && p.exists()) { IRuntime projectTarget = ServerSelectionUtils.getRuntimeTarget(p.getName()); if (projectTarget!=null) { String projectTargetId = projectTarget.getRuntimeType().getId(); String serverTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverFactoryId); if (serverTargetId!=null && serverTargetId.length()>0) { if(!projectTargetId.equals(serverTargetId)) { return StatusUtils.errorStatus( NLS.bind(ConsumptionUIMessages.MSG_SERVER_TARGET_MISMATCH,new String[]{p.getName()}) ); } } } } return Status.OK_STATUS; }
} else { title = Messages.wizEditRuntimeWizardTitle; final WizardFragment fragment2 = ServerUIPlugin.getWizardFragment(runtimeWorkingCopy.getRuntimeType().getId()); if (fragment2 == null) { edit.setEnabled(false);
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; WizardFragment sub = getWizardFragment(runtime.getRuntimeType().getId()); if (sub != null) list.add(sub);
/** * @see ITomcatVersionHandler#prepareForServingDirectly(IPath, TomcatServer) */ public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server) { IStatus status; // If serving modules without publishing, loader jar is needed if (server.isServeModulesWithoutPublish()) { status = TomcatVersionHelper.copyLoaderJar( getRuntimeBaseDirectory(server).append("server/lib"), server.getServer().getRuntime().getRuntimeType().getId()); // If copy successful and running a separate server instance, modify catalina.properties if (status.isOK() && server.isTestEnvironment()) { status = TomcatVersionHelper.updatePropertiesToServeDirectly(baseDir, "server/lib", "server"); } } // Else ensure jar is removed else { TomcatVersionHelper.removeLoaderJar( getRuntimeBaseDirectory(server).append("server/lib"), server.getServer().getRuntime().getRuntimeType().getId()); // TODO Decide what to do with removal warning, maybe nothing status = Status.OK_STATUS; } return status; }
/** * @see ITomcatVersionHandler#prepareForServingDirectly(IPath, TomcatServer) */ public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server) { IStatus status; // If serving modules without publishing, loader jar is needed // TODO Need to examine catalina.properties to ensure loader jar and catalina.properties are handled appropriately if (server.isServeModulesWithoutPublish()) { status = TomcatVersionHelper.copyLoaderJar( getRuntimeBaseDirectory(server).append("lib"), server.getServer().getRuntime().getRuntimeType().getId()); // If copy successful and running a separate server instance, modify catalina.properties if (status.isOK() && server.isTestEnvironment()) { status = TomcatVersionHelper.updatePropertiesToServeDirectly(baseDir, "lib", "common"); } } // Else ensure jar is removed else { TomcatVersionHelper.removeLoaderJar( getRuntimeBaseDirectory(server).append("lib"), server.getServer().getRuntime().getRuntimeType().getId()); // TODO Decide what to do with removal warning, maybe nothing status = Status.OK_STATUS; } return status; }
if (element instanceof IRuntimeType) { IRuntimeType runtimeType = (IRuntimeType) element; return ImageResource.getImageDescriptor(runtimeType.getId()); } else if (element instanceof IRuntime) { IRuntime runtime = (IRuntime) element; return ImageResource.getImageDescriptor(runtime.getRuntimeType().getId()); } else if (element instanceof IServerType) { IServerType serverType = (IServerType) element;
/** * @param module * @param runtime * @return */ public List getDeployModuleExtensions(IProject project, IRuntime runtime) { String typeID = ""; //$NON-NLS-1$ if (J2EEProjectUtilities.isEARProject(project)) typeID = J2EEProjectUtilities.ENTERPRISE_APPLICATION; else if (J2EEProjectUtilities.isApplicationClientProject(project)) typeID = J2EEProjectUtilities.APPLICATION_CLIENT; else if (J2EEProjectUtilities.isDynamicWebProject(project)) typeID = J2EEProjectUtilities.DYNAMIC_WEB; else if (J2EEProjectUtilities.isStaticWebProject(project)) typeID = J2EEProjectUtilities.STATIC_WEB; else if (J2EEProjectUtilities.isEJBProject(project)) typeID = J2EEProjectUtilities.EJB; else if (J2EEProjectUtilities.isJCAProject(project)) typeID = J2EEProjectUtilities.JCA; else if (J2EEProjectUtilities.isUtilityProject(project)) typeID = J2EEProjectUtilities.UTILITY; String runtimeID = runtime.getRuntimeType().getId(); return getDeployers(typeID, runtimeID); }
IRuntime runtime = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME); if (runtime != null && runtime instanceof IRuntimeWorkingCopy) { WizardFragment sub = getWizardFragment(runtime.getRuntimeType().getId()); if (sub != null) list.add(sub);