Example usage for com.intellij.openapi.actionSystem DataSink DataSink

List of usage examples for com.intellij.openapi.actionSystem DataSink DataSink

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem DataSink DataSink.

Prototype

DataSink

Source Link

Usage

From source file:com.intellij.usages.impl.UsageViewManagerImpl.java

License:Apache License

@NotNull
SearchScope getMaxSearchScopeToWarnOfFallingOutOf(@NotNull UsageTarget[] searchFor) {
    UsageTarget target = searchFor[0];//from  ww w. ja v  a  2s  .  c  o m
    if (target instanceof TypeSafeDataProvider) {
        final SearchScope[] scope = new SearchScope[1];
        ((TypeSafeDataProvider) target).calcData(UsageView.USAGE_SCOPE, new DataSink() {
            @Override
            public <T> void put(DataKey<T> key, T data) {
                scope[0] = (SearchScope) data;
            }
        });
        return scope[0];
    }
    return GlobalSearchScope.allScope(myProject); // by default do not warn of falling out of scope
}