@Override public Category createCategory(Lookup context) { Project project = context.lookup(Project.class); NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class); String effPackaging = watcher.getPackagingType(); String[] types = PluginPropertyUtils.getPluginPropertyList(project, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, "supportedProjectTypes", "supportedProjectType", /*"bundle" would not work for GlassFish parent POM*/null); if (types != null) { for (String type : types) { if (effPackaging.equals(type)) { effPackaging = NbMavenProject.TYPE_OSGI; } } } if (NbMavenProject.TYPE_OSGI.equalsIgnoreCase(effPackaging)) { return ProjectCustomizer.Category.create( ModelHandle2.PANEL_COMPILE, org.openide.util.NbBundle.getMessage(PackagesPanelProvider.class, "TIT_Packages"), null); } return null; }
private void checkContent(Project prj, InstanceContent ic, AccessQueryImpl access, ForeignClassBundlerImpl bundler, RecommendedTemplates templates) { NbMavenProject nbprj = prj.getLookup().lookup(NbMavenProject.class); String effPackaging = nbprj.getPackagingType(); String[] types = PluginPropertyUtils.getPluginPropertyList(prj, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, "supportedProjectTypes", "supportedProjectType", /*"bundle" would not work for GlassFish parent POM*/null); if (types != null) { for (String type : types) { if (effPackaging.equals(type)) { effPackaging = NbMavenProject.TYPE_OSGI; } } } if (NbMavenProject.TYPE_OSGI.equals(effPackaging)) { ic.add(access); ic.add(bundler); ic.add(templates); } else { ic.remove(access); ic.remove(bundler); ic.remove(templates); } }