EjbNodeList(WebProject proj) { this.project = proj; this.projectCap = J2eeProjectCapabilities.forProject(project); }
@Override public boolean supportsDefaultProvider() { final J2eeProjectCapabilities capabilities = J2eeProjectCapabilities.forProject(project); if (capabilities != null) { return capabilities.hasDefaultPersistenceProvider(); } return false; } }
public List<Key> getExtraKeys() { J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(p); if (projectCap.isEjb31LiteSupported()){ return Collections.<Key>singletonList(new LibrariesNode.Key(ExtraLibrariesTestNode.class.getName())); } else { return Collections.<Key>emptyList(); } }
@Override public boolean isInjectionTarget(CompilationController controller, TypeElement typeElement) { if (controller == null || typeElement==null) { throw new NullPointerException("Passed null to EEInjectiontargetQueryImplementation.isInjectionTarget(CompilationController, TypeElement)"); // NOI18N } FileObject fo = controller.getFileObject(); Project project = FileOwnerQuery.getOwner(fo); J2eeProjectCapabilities j2eeProjectCapabilities = J2eeProjectCapabilities.forProject(project); if (j2eeProjectCapabilities == null) { return false; } boolean ejb31 = j2eeProjectCapabilities.isEjb31Supported() || j2eeProjectCapabilities.isEjb31LiteSupported();//it's foe ee6 only or common annotations 1.1 if (ejb31 && !(ElementKind.INTERFACE==typeElement.getKind())) { List<? extends AnnotationMirror> annotations = typeElement.getAnnotationMirrors(); boolean found = false; for (AnnotationMirror m : annotations) { Name qualifiedName = ((TypeElement)m.getAnnotationType().asElement()).getQualifiedName(); if (qualifiedName.contentEquals("javax.annotation.ManagedBean")) { //NOI18N found = true; break; } } if (found) return true; } return false; }
private void checkEnvironment() { if (!checked) { final Object srcType = helper.getStandardPropertyEvaluator(). getProperty(WebProjectProperties.JAVA_SOURCE_BASED); if ("false".equals(srcType)) { isArchive = true; } projectCap = J2eeProjectCapabilities.forProject(project); Profile profile = Profile.fromPropertiesString(eval.getProperty(WebProjectProperties.J2EE_PLATFORM)); isEE5 = profile == Profile.JAVA_EE_5; serverSupportsEJB31 = ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_6_FULL) || ProjectUtil.getSupportedProfiles(project).contains(Profile.JAVA_EE_7_FULL); checked = true; } }
void read(WizardDescriptor settings) { jsfFolder.setText((String) settings.getProperty(WizardProperties.JSF_FOLDER)); project = Templates.getProject(settings); projectTextField.setText(ProjectUtils.getInformation(project).getDisplayName()); SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project); SourceGroupUISupport.connect(locationComboBox, sourceGroups); jsfPackageComboBox.setRenderer(PackageView.listRenderer()); updateSourceGroupPackages(); if(J2eeProjectCapabilities.forProject(project).isEjb31LiteSupported()) { //change label if we will generate session beans jpaPackageLabel.setText(org.openide.util.NbBundle.getMessage(PersistenceClientSetupPanelVisual.class, "LBL_Jpa_SessionBean_Package")); // NOI18N } if (localizationBundleTextField.getText().length() == 0) { localizationBundleTextField.setText(NbBundle.getMessage(PersistenceClientSetupPanelVisual.class, "PersistenceClientSetupPanelVisual.defaultBundleName")); // NOI18N } boolean jsf2Generator = "true".equals(settings.getProperty(PersistenceClientIterator.JSF2_GENERATOR_PROPERTY)); ajaxifyCheckbox.setVisible(!jsf2Generator); overrideExistingCheckBox.setVisible(jsf2Generator); customizeTemplatesLabel.setVisible(jsf2Generator); localizationBundleLabel.setVisible(jsf2Generator); localizationBundleTextField.setVisible(jsf2Generator); }
public void run() { final boolean genSessionBean=J2eeProjectCapabilities.forProject(project).isEjb31LiteSupported(); try { javaPackageRoot.getFileSystem().runAtomicAction(new FileSystem.AtomicAction() {
public Set<DataObject> instantiate(TemplateWizard wizard) throws IOException { String targetName = Templates.getTargetName(wizard); FileObject targetDir = Templates.getTargetFolder(wizard); Project project = Templates.getProject(wizard); boolean useCDI11 = true; if (project != null) { J2eeProjectCapabilities cap = J2eeProjectCapabilities.forProject(project); if (cap != null && !cap.isCdi11Supported()) { useCDI11 = false; } } FileObject fo = DDHelper.createBeansXml( useCDI11 ? Profile.JAVA_EE_7_FULL : Profile.JAVA_EE_6_FULL, targetDir, targetName); if (fo != null) { if ( project != null ){ CdiUtil logger = project.getLookup().lookup( CdiUtil.class ); if (logger != null){ logger.log("USG_CDI_BEANS_WIZARD", BeansXmlIterator.class, new Object[]{project.getClass().getName()}, true); } } return Collections.singleton(DataObject.find(fo)); } else { return Collections.EMPTY_SET; } }