public FelixExportPersister (Project project, ModelHandle2 handle) { this.project = project; this.handle = handle; String[] exports = PluginPropertyUtils.getPluginPropertyList(project, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, OSGiConstants.PARAM_INSTRUCTIONS, OSGiConstants.EXPORT_PACKAGE, OSGiConstants.GOAL_MANIFEST); String exportInstruction = null; if (exports != null && exports.length == 1) { exportInstruction = exports[0]; isDefined = true; } else { isDefined = false; } String[] privates = PluginPropertyUtils.getPluginPropertyList(project, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, OSGiConstants.PARAM_INSTRUCTIONS, OSGiConstants.PRIVATE_PACKAGE, OSGiConstants.GOAL_MANIFEST); String privateInstruction = null; if (privates != null && privates.length == 1) { privateInstruction = privates[0]; } Map<Integer, String> instructions = new HashMap<Integer, String>(2); instructions.put(InstructionsConverter.EXPORT_PACKAGE, exportInstruction); instructions.put(InstructionsConverter.PRIVATE_PACKAGE, privateInstruction); defaultValue = InstructionsConverter.computeExportList(instructions, project); }
private Boolean check(String value) { String[] exps = PluginPropertyUtils.getPluginPropertyList(prj, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, OSGiConstants.PARAM_INSTRUCTIONS, OSGiConstants.EXPORT_PACKAGE, OSGiConstants.GOAL_MANIFEST); String[] imps = PluginPropertyUtils.getPluginPropertyList(prj, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, OSGiConstants.PARAM_INSTRUCTIONS, OSGiConstants.PRIVATE_PACKAGE,
@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); } }