List of usage examples for com.intellij.openapi.actionSystem DataSink DataSink
DataSink
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
}