コード例 #1
0
 /** @see IValidator#validate(Object, Object) */
 public Map<String, IStatus> validate(Object value, Object context) {
   final String deploymentType = value.toString();
   if (!ISeamFacetDataModelProperties.DEPLOY_AS_WAR.equals(deploymentType)) {
     Object runtimeName =
         model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
     if (runtimeName != null) {
       IRuntime rt = RuntimeManager.getRuntime(runtimeName.toString());
       if (!rt.supports(EJB_30) || !rt.supports(EAR_50)) {
         return SeamValidatorFactory.createErrormessage(
             propertyName,
             new Status(
                 IStatus.ERROR,
                 SeamCorePlugin.PLUGIN_ID,
                 NLS.bind(
                     SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_CANNOT_USE_SELECTED_DEPLOYMENT6,
                     new String[] {deploymentType.toUpperCase(), runtimeName.toString()})));
       }
     }
   }
   return SeamValidatorFactory.NO_ERRORS;
 }