* To change this template use File | Settings | File Templates.
*/
public class UsageTypeGroupingRule implements UsageGroupingRule {
public UsageGroup groupUsage(Usage usage) {
if (usage instanceof PsiElementUsage) {
PsiElementUsage elementUsage = (PsiElementUsage)usage;
UsageType usageType = getUsageType(elementUsage.getElement());
if (usageType != null) return new UsageTypeGroup(usageType);
if (usage instanceof ReadWriteAccessUsage) {
ReadWriteAccessUsage u = (ReadWriteAccessUsage)usage;
if (u.isAccessedForWriting()) return new UsageTypeGroup(UsageType.WRITE);