Java 类com.intellij.util.xml.highlighting.DomHighlightingHelper 实例源码

项目:intellij-ce-playground    文件:ExtendsClassChecker.java   
public List<DomElementProblemDescriptor> checkForProblems(@NotNull final ExtendClass extend, @NotNull final DomElement _element, @NotNull final DomElementAnnotationHolder holder,
                          @NotNull final DomHighlightingHelper helper) {
  if (!(_element instanceof GenericDomValue)) return Collections.emptyList();
  GenericDomValue element = (GenericDomValue)_element;

  if (!isPsiClassType(element)) return Collections.emptyList();

  final Object valueObject = element.getValue();
  PsiClass psiClass = null;

  if (valueObject instanceof PsiClass) {
    psiClass = (PsiClass)valueObject;
  } else if (valueObject instanceof PsiClassType) {
    psiClass = ((PsiClassType)valueObject).resolve();
  }

  if (psiClass != null) {
      return checkExtendClass(element, psiClass, extend.value(),
                              extend.instantiatable(), extend.canBeDecorator(), extend.allowInterface(),
                              extend.allowNonPublic(), extend.allowAbstract(), extend.allowEnum(), holder);
  }
  return Collections.emptyList();
}
项目:intellij-ce-playground    文件:AntMissingPropertiesFileInspection.java   
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  if (element instanceof AntDomProperty) {
    final AntDomProperty property = (AntDomProperty)element;
    final GenericAttributeValue<PsiFileSystemItem> fileValue = property.getFile();
    final String fileName = fileValue.getStringValue();
    if (fileName != null) {
      final PropertiesFile propertiesFile = property.getPropertiesFile();
      if (propertiesFile == null) {
        final PsiFileSystemItem file = fileValue.getValue();
        if (file instanceof XmlFile) {
          holder.createProblem(fileValue, AntBundle.message("file.type.xml.not.supported", fileName));
        }
        else if (file instanceof PsiFile) {
          holder.createProblem(fileValue, AntBundle.message("file.type.not.supported", fileName));
        }
        else {
          holder.createProblem(fileValue, AntBundle.message("file.doesnt.exist", fileName));
        }
      }
    }
  }
}
项目:tools-idea    文件:ExtendsClassChecker.java   
public List<DomElementProblemDescriptor> checkForProblems(@NotNull final ExtendClass extend, @NotNull final DomElement _element, @NotNull final DomElementAnnotationHolder holder,
                          @NotNull final DomHighlightingHelper helper) {
  if (!(_element instanceof GenericDomValue)) return Collections.emptyList();
  GenericDomValue element = (GenericDomValue)_element;

  if (!isPsiClassType(element)) return Collections.emptyList();

  final Object valueObject = element.getValue();
  PsiClass psiClass = null;

  if (valueObject instanceof PsiClass) {
    psiClass = (PsiClass)valueObject;
  } else if (valueObject instanceof PsiClassType) {
    psiClass = ((PsiClassType)valueObject).resolve();
  }

  if (psiClass != null) {
      return checkExtendClass(element, psiClass, extend.value(),
                              extend.instantiatable(), extend.canBeDecorator(), extend.allowInterface(),
                              extend.allowNonPublic(), extend.allowAbstract(), extend.allowEnum(), holder);
  }
  return Collections.emptyList();
}
项目:consulo-java    文件:ExtendsClassChecker.java   
public List<DomElementProblemDescriptor> checkForProblems(@NotNull final ExtendClass extend, @NotNull final DomElement _element, @NotNull final DomElementAnnotationHolder holder,
                          @NotNull final DomHighlightingHelper helper) {
  if (!(_element instanceof GenericDomValue)) return Collections.emptyList();
  GenericDomValue element = (GenericDomValue)_element;

  if (!isPsiClassType(element)) return Collections.emptyList();

  final Object valueObject = element.getValue();
  PsiClass psiClass = null;

  if (valueObject instanceof PsiClass) {
    psiClass = (PsiClass)valueObject;
  } else if (valueObject instanceof PsiClassType) {
    psiClass = ((PsiClassType)valueObject).resolve();
  }

  if (psiClass != null) {
      return checkExtendClass(element, psiClass, extend.value(),
                              extend.instantiatable(), extend.canBeDecorator(), extend.allowInterface(),
                              extend.allowNonPublic(), extend.allowAbstract(), extend.allowEnum(), holder);
  }
  return Collections.emptyList();
}
项目:intellij-ce-playground    文件:ExtensionPointBeanClassInspection.java   
@Override
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  if (element instanceof ExtensionPoint) {
    ExtensionPoint extensionPoint = (ExtensionPoint)element;
    if (extensionPoint.getWithElements().isEmpty() && !collectMissingWithTags(extensionPoint).isEmpty()) {
      holder.createProblem(extensionPoint,
                           "<extensionPoint> does not have <with> tags to specify the types of class fields",
                           new AddWithTagFix());
    }
  }
}
项目:tools-idea    文件:AntMissingPropertiesFileInspection.java   
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  if (element instanceof AntDomProperty) {
    final AntDomProperty property = (AntDomProperty)element;
    final String fileName = property.getFile().getStringValue();
    if (fileName != null) {
      final PsiFileSystemItem file = property.getFile().getValue();
      if (!(file instanceof PropertiesFile)) {
        holder.createProblem(property.getFile(), AntBundle.message("file.doesnt.exist", fileName));
      }
    }
  }
}
项目:tools-idea    文件:ExtensionPointBeanClassInspection.java   
@Override
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  if (element instanceof ExtensionPoint) {
    ExtensionPoint extensionPoint = (ExtensionPoint)element;
    if (extensionPoint.getWithElements().isEmpty() && !collectMissingWithTags(extensionPoint).isEmpty()) {
      holder.createProblem(extensionPoint,
                           "<extensionPoint> does not have <with> tags to specify the types of class fields",
                           new AddWithTagFix());
    }
  }
}
项目:consulo-apache-ant    文件:AntMissingPropertiesFileInspection.java   
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  if (element instanceof AntDomProperty) {
    final AntDomProperty property = (AntDomProperty)element;
    final String fileName = property.getFile().getStringValue();
    if (fileName != null) {
      final PsiFileSystemItem file = property.getFile().getValue();
      if (!(file instanceof PropertiesFile)) {
        holder.createProblem(property.getFile(), AntBundle.message("file.doesnt.exist", fileName));
      }
    }
  }
}