use of org.fest.reflect.exception.ReflectionError in project intellij-community by JetBrains.
the class IdeaDialogFixture method getDialogWrapperFrom.
@Nullable
protected static <T extends DialogWrapper> T getDialogWrapperFrom(@NotNull JDialog dialog, Class<T> dialogWrapperType) {
try {
WeakReference<DialogWrapper> dialogWrapperRef = field("myDialogWrapper").ofType(new TypeRef<WeakReference<DialogWrapper>>() {
}).in(dialog).get();
assertNotNull(dialogWrapperRef);
DialogWrapper wrapper = dialogWrapperRef.get();
if (dialogWrapperType.isInstance(wrapper)) {
return dialogWrapperType.cast(wrapper);
}
} catch (ReflectionError ignored) {
}
return null;
}
Aggregations