Java 类com.intellij.openapi.actionSystem.TypeSafeDataProvider 实例源码

项目:intellij-ce-playground    文件:UsageViewManagerImpl.java   
@NotNull
SearchScope getMaxSearchScopeToWarnOfFallingOutOf(@NotNull UsageTarget[] searchFor) {
  UsageTarget target = searchFor[0];
  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
}
项目:intellij-ce-playground    文件:GlassPaneDialogWrapperPeer.java   
@Override
public Object getData(@NonNls final String dataId) {
  final DialogWrapper wrapper = myDialogWrapper.get();
  if (wrapper instanceof DataProvider) {
    return ((DataProvider) wrapper).getData(dataId);
  } else if (wrapper instanceof TypeSafeDataProvider) {
    TypeSafeDataProviderAdapter adapter = new TypeSafeDataProviderAdapter((TypeSafeDataProvider) wrapper);
    return adapter.getData(dataId);
  }
  return null;
}
项目:tools-idea    文件:GlassPaneDialogWrapperPeer.java   
public Object getData(@NonNls final String dataId) {
  final DialogWrapper wrapper = myDialogWrapper.get();
  if (wrapper instanceof DataProvider) {
    return ((DataProvider) wrapper).getData(dataId);
  } else if (wrapper instanceof TypeSafeDataProvider) {
    TypeSafeDataProviderAdapter adapter = new TypeSafeDataProviderAdapter((TypeSafeDataProvider) wrapper);
    return adapter.getData(dataId);
  }
  return null;
}
项目:consulo    文件:UsageViewManagerImpl.java   
@Nonnull
SearchScope getMaxSearchScopeToWarnOfFallingOutOf(@Nonnull UsageTarget[] searchFor) {
  UsageTarget target = searchFor.length > 0 ? searchFor[0] : null;
  if (target instanceof TypeSafeDataProvider) {
    final SearchScope[] scope = new SearchScope[1];
    ((TypeSafeDataProvider)target).calcData(UsageView.USAGE_SCOPE, new DataSink() {
      @Override
      public <T> void put(Key<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
}
项目:consulo    文件:GlassPaneDialogWrapperPeer.java   
@Override
public Object getData(@NonNls final Key dataId) {
  final DialogWrapper wrapper = myDialogWrapper.get();
  if (wrapper instanceof DataProvider) {
    return ((DataProvider) wrapper).getData(dataId);
  } else if (wrapper instanceof TypeSafeDataProvider) {
    TypeSafeDataProviderAdapter adapter = new TypeSafeDataProviderAdapter((TypeSafeDataProvider) wrapper);
    return adapter.getData(dataId);
  }
  return null;
}
项目:intellij-ce-playground    文件:TypeSafeDataProviderAdapter.java   
public TypeSafeDataProviderAdapter(@NotNull TypeSafeDataProvider provider) {
  myProvider = provider;
}
项目:tools-idea    文件:TypeSafeDataProviderAdapter.java   
public TypeSafeDataProviderAdapter(final TypeSafeDataProvider provider) {
  myProvider = provider;
}
项目:consulo    文件:TypeSafeDataProviderAdapter.java   
public TypeSafeDataProviderAdapter(final TypeSafeDataProvider provider) {
  myProvider = provider;
}
项目:consulo-xml    文件:DomTableView.java   
public void addCustomDataProvider(TypeSafeDataProvider provider) {
  myCustomDataProviders.add(provider);
}
项目:consulo-xml    文件:DomTableView.java   
public void calcData(final Key<?> key, final DataSink sink) {
  super.calcData(key, sink);
  for (final TypeSafeDataProvider customDataProvider : myCustomDataProviders) {
    customDataProvider.calcData(key, sink);
  }
}