public static String[] getFeaturePaths() { IFeatureModel[] models = MDECore.getDefault().getFeatureModelManager().getModels(); ArrayList list = new ArrayList(); for (int i = 0; i < models.length; i++) { String location = models[i].getInstallLocation(); if (location != null) list.add(location + IPath.SEPARATOR + ICoreConstants.FEATURE_FILENAME_DESCRIPTOR); } return (String[]) list.toArray(new String[list.size()]); }
public static boolean matchesCurrentEnvironment(IMonitorModelBase model) { BundleContext context = MDECore.getDefault().getBundleContext(); Dictionary environment = getTargetEnvironment(); BundleDescription bundle = model.getBundleDescription(); String filterSpec = bundle != null ? bundle.getPlatformFilter() : null; try { return filterSpec == null || context.createFilter(filterSpec).match(environment); } catch (InvalidSyntaxException e) { return false; } }
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 MDEState getPDEState() { return MDECore.getDefault().getModelManager().getState(); }