Search in sources :

Example 1 with ComplementPackageSet

use of com.intellij.psi.search.scope.packageSet.ComplementPackageSet in project intellij-community by JetBrains.

the class DependencyRule method isForbiddenToUse.

public boolean isForbiddenToUse(@NotNull PsiFile from, @NotNull PsiFile to) {
    if (myFromScope == null || myToScope == null)
        return false;
    final PackageSet fromSet = myFromScope.getValue();
    final PackageSet toSet = myToScope.getValue();
    if (fromSet == null || toSet == null)
        return false;
    DependencyValidationManager holder = DependencyValidationManager.getInstance(from.getProject());
    return (myDenyRule ? fromSet.contains(from, holder) : new ComplementPackageSet(fromSet).contains(from, holder)) && toSet.contains(to, holder);
}
Also used : ComplementPackageSet(com.intellij.psi.search.scope.packageSet.ComplementPackageSet) PackageSet(com.intellij.psi.search.scope.packageSet.PackageSet) ComplementPackageSet(com.intellij.psi.search.scope.packageSet.ComplementPackageSet)

Example 2 with ComplementPackageSet

use of com.intellij.psi.search.scope.packageSet.ComplementPackageSet in project intellij-community by JetBrains.

the class DependencyRule method isApplicable.

public boolean isApplicable(@NotNull PsiFile file) {
    if (myFromScope == null || myToScope == null)
        return false;
    final PackageSet fromSet = myFromScope.getValue();
    if (fromSet == null)
        return false;
    DependencyValidationManager holder = DependencyValidationManager.getInstance(file.getProject());
    return myDenyRule ? fromSet.contains(file, holder) : new ComplementPackageSet(fromSet).contains(file, holder);
}
Also used : ComplementPackageSet(com.intellij.psi.search.scope.packageSet.ComplementPackageSet) PackageSet(com.intellij.psi.search.scope.packageSet.PackageSet) ComplementPackageSet(com.intellij.psi.search.scope.packageSet.ComplementPackageSet)

Aggregations

ComplementPackageSet (com.intellij.psi.search.scope.packageSet.ComplementPackageSet)2 PackageSet (com.intellij.psi.search.scope.packageSet.PackageSet)2