public static TreeSet getProductNameSet() {
   TreeSet result = new TreeSet();
   IExtension[] extensions =
       MDECore.getDefault()
           .getExtensionsRegistry()
           .findExtensions("org.eclipse.core.runtime.products", true); // $NON-NLS-1$
   for (int i = 0; i < extensions.length; i++) {
     IConfigurationElement[] elements = extensions[i].getConfigurationElements();
     if (elements.length != 1) continue;
     if (!"product".equals(elements[0].getName())) // $NON-NLS-1$
     continue;
     String id = extensions[i].getUniqueIdentifier();
     if (id != null && id.trim().length() > 0) result.add(id);
   }
   return result;
 }
 public static Set getApplicationNameSet() {
   TreeSet result = new TreeSet();
   IExtension[] extensions =
       MDECore.getDefault()
           .getExtensionsRegistry()
           .findExtensions("org.eclipse.core.runtime.applications", true); // $NON-NLS-1$
   for (int i = 0; i < extensions.length; i++) {
     String id = extensions[i].getUniqueIdentifier();
     IConfigurationElement[] elements = extensions[i].getConfigurationElements();
     if (elements.length != 1) continue;
     String visiblity = elements[0].getAttribute("visible"); // $NON-NLS-1$
     boolean visible = visiblity == null ? true : Boolean.valueOf(visiblity).booleanValue();
     if (id != null && visible) {
       result.add(id);
     }
   }
   result.add("org.eclipse.ui.ide.workbench"); // $NON-NLS-1$
   return result;
 }
 public static String[] getProductNames() {
   TreeSet result = getProductNameSet();
   return (String[]) result.toArray(new String[result.size()]);
 }