Search in sources :

Example 1 with UsageInModule

use of com.intellij.usages.rules.UsageInModule in project intellij-community by JetBrains.

the class ModuleGroupingRule method groupUsage.

@Override
public UsageGroup groupUsage(@NotNull Usage usage) {
    if (usage instanceof UsageInModule) {
        UsageInModule usageInModule = (UsageInModule) usage;
        Module module = usageInModule.getModule();
        if (module != null)
            return new ModuleUsageGroup(module);
    }
    if (usage instanceof UsageInLibrary) {
        UsageInLibrary usageInLibrary = (UsageInLibrary) usage;
        OrderEntry entry = usageInLibrary.getLibraryEntry();
        if (entry != null)
            return new LibraryUsageGroup(entry);
    }
    return null;
}
Also used : OrderEntry(com.intellij.openapi.roots.OrderEntry) UsageInModule(com.intellij.usages.rules.UsageInModule) UsageInLibrary(com.intellij.usages.rules.UsageInLibrary) UsageInModule(com.intellij.usages.rules.UsageInModule) Module(com.intellij.openapi.module.Module)

Aggregations

Module (com.intellij.openapi.module.Module)1 OrderEntry (com.intellij.openapi.roots.OrderEntry)1 UsageInLibrary (com.intellij.usages.rules.UsageInLibrary)1 UsageInModule (com.intellij.usages.rules.UsageInModule)1