use of eu.fthevenet.binjr.data.exceptions.NoAdapterFoundException in project selenium_java by sergueik.
the class MainViewController method populateSourceMenu.
// region private members
private Collection<MenuItem> populateSourceMenu() {
List<MenuItem> menuItems = new ArrayList<>();
for (DataAdapterInfo adapterInfo : DataAdapterFactory.getInstance().getActiveAdapters()) {
MenuItem menuItem = new MenuItem(adapterInfo.getName());
menuItem.setOnAction(eventHandler -> {
try {
showAdapterDialog(DataAdapterFactory.getInstance().getDialog(adapterInfo.getKey(), root));
} catch (NoAdapterFoundException e) {
Dialogs.notifyException("Could not find source adapter " + adapterInfo.getName(), e, root);
} catch (CannotInitializeDataAdapterException e) {
Dialogs.notifyException("Could not initialize source adapter " + adapterInfo.getName(), e, root);
}
});
menuItems.add(menuItem);
}
return menuItems;
}
Aggregations