public static Map getPatchMap(MDEState state) {
   HashMap properties = new HashMap();
   IMonitorModelBase[] models = MonitorRegistry.getActiveModels();
   for (int i = 0; i < models.length; i++) {
     BundleDescription desc = models[i].getBundleDescription();
     if (desc == null) continue;
     Long id = new Long(desc.getBundleId());
     if (ClasspathUtilCore.hasExtensibleAPI(models[i])) {
       properties.put(id, ICoreConstants.EXTENSIBLE_API + ": true"); // $NON-NLS-1$
     } else if (ClasspathUtilCore.isPatchFragment(models[i])) {
       properties.put(id, ICoreConstants.PATCH_FRAGMENT + ": true"); // $NON-NLS-1$
     }
   }
   return properties;
 }
 private static String[] getValue(BundleDescription bundle, MDEState state) {
   IMonitorModelBase model = MonitorRegistry.findModel(bundle);
   String[] result = null;
   if (model != null) {
     IMonitorLibrary[] libs = model.getMonitorBase().getLibraries();
     result = new String[libs.length];
     for (int i = 0; i < libs.length; i++) {
       result[i] = libs[i].getName();
     }
   } else {
     String[] libs = state.getLibraryNames(bundle.getBundleId());
     result = new String[libs.length];
     for (int i = 0; i < libs.length; i++) {
       result[i] = libs[i];
     }
   }
   if (result.length == 0) return new String[] {"."}; // $NON-NLS-1$
   return result;
 }
  public static String getTargetVersionString() {
    IMonitorModelBase model = MonitorRegistry.findModel(IPDEBuildConstants.BUNDLE_OSGI);
    if (model == null) return ICoreConstants.TARGET37;

    String version = model.getMonitorBase().getVersion();
    if (VersionUtil.validateVersion(version).getSeverity() == IStatus.OK) {
      Version vid = new Version(version);
      int major = vid.getMajor();
      int minor = vid.getMinor();
      if (major == 3 && minor == 0) return ICoreConstants.TARGET30;
      if (major == 3 && minor == 1) return ICoreConstants.TARGET31;
      if (major == 3 && minor == 2) return ICoreConstants.TARGET32;
      if (major == 3 && minor == 3) return ICoreConstants.TARGET33;
      if (major == 3 && minor == 4) return ICoreConstants.TARGET34;
      if (major == 3 && minor == 5) return ICoreConstants.TARGET35;
      if (major == 3 && minor == 6) return ICoreConstants.TARGET36;
    }
    return ICoreConstants.TARGET37;
  }
 public static boolean usesNewApplicationModel() {
   return MonitorRegistry.findModel("org.eclipse.equinox.app") != null; // $NON-NLS-1$
 }