コード例 #1
0
 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()]);
 }
コード例 #2
0
 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;
   }
 }
コード例 #3
0
 protected void validateExtension(Element element) {
   if (!assertAttributeDefined(element, "point", CompilerFlags.ERROR)) // $NON-NLS-1$
   return;
   String pointID = element.getAttribute("point"); // $NON-NLS-1$
   if (!MDECore.getDefault().getExtensionsRegistry().hasExtensionPoint(pointID)) {
     int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_UNRESOLVED_EX_POINTS);
     if (severity != CompilerFlags.IGNORE) {
       report(
           NLS.bind(MDECoreMessages.Builders_Manifest_ex_point, pointID),
           getLine(element, "point"),
           severity,
           MDEMarkerFactory.CAT_OTHER); // $NON-NLS-1$
     }
   } else {
     SchemaRegistry reg = MDECore.getDefault().getSchemaRegistry();
     ISchema schema = reg.getSchema(pointID);
     if (schema != null) {
       validateElement(element, schema, true);
     }
   }
 }
コード例 #4
0
 private void validateFeatureID(Element element, Attr attr) {
   int severity = CompilerFlags.getFlag(fProject, CompilerFlags.F_UNRESOLVED_FEATURES);
   if (severity != CompilerFlags.IGNORE) {
     IFeatureModel[] models =
         MDECore.getDefault().getFeatureModelManager().findFeatureModels(attr.getValue());
     if (models.length == 0) {
       report(
           NLS.bind(MDECoreMessages.Builders_Feature_freference, attr.getValue()),
           getLine(element, attr.getName()),
           severity,
           MDEMarkerFactory.CAT_OTHER);
     }
   }
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 public static MDEState getPDEState() {
   return MDECore.getDefault().getModelManager().getState();
 }