コード例 #1
0
 protected void reportDeprecatedRootElement(Element element, String suggestion) {
   int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_DEPRECATED);
   if (severity != CompilerFlags.IGNORE) {
     String point = element.getAttribute("point"); // $NON-NLS-1$
     if (point == null) return; // should never come to this...
     String message;
     if (suggestion != null)
       message =
           NLS.bind(
               MDECoreMessages.Builders_Manifest_deprecated_rootElementSuggestion,
               point,
               suggestion);
     else message = NLS.bind(MDECoreMessages.Builders_Manifest_deprecated_rootElement, point);
     report(
         message,
         getLine(element, "point"),
         severity,
         MDEMarkerFactory.CAT_DEPRECATION); // $NON-NLS-1$
   }
 }
コード例 #2
0
  private void validateInternalExtensionAttribute(Element element, ISchemaElement schemaElement) {
    int severity = CompilerFlags.getFlag(fProject, CompilerFlags.P_INTERNAL);
    if (severity == CompilerFlags.IGNORE) return;

    if (schemaElement instanceof ISchemaRootElement) {
      ISchemaRootElement rootElement = (ISchemaRootElement) schemaElement;
      String epid = schemaElement.getSchema().getPluginId();
      String pid = fModel.getMonitorBase().getId();
      if (epid == null || pid == null) return;
      if (rootElement.isInternal() && !epid.equals(pid)) {
        String point = element.getAttribute("point"); // $NON-NLS-1$
        if (point == null) return; // should never come to this...
        report(
            NLS.bind(MDECoreMessages.Builders_Manifest_internal_rootElement, point),
            getLine(element, "point"),
            severity,
            MDEMarkerFactory.CAT_DEPRECATION); // $NON-NLS-1$
      }
    }
  }
コード例 #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);
     }
   }
 }