Search in sources :

Example 1 with NoAdapterFoundException

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;
}
Also used : NoAdapterFoundException(eu.fthevenet.binjr.data.exceptions.NoAdapterFoundException) DataAdapterInfo(eu.fthevenet.binjr.data.adapters.DataAdapterInfo) CannotInitializeDataAdapterException(eu.fthevenet.binjr.data.exceptions.CannotInitializeDataAdapterException)

Aggregations

DataAdapterInfo (eu.fthevenet.binjr.data.adapters.DataAdapterInfo)1 CannotInitializeDataAdapterException (eu.fthevenet.binjr.data.exceptions.CannotInitializeDataAdapterException)1 NoAdapterFoundException (eu.fthevenet.binjr.data.exceptions.NoAdapterFoundException)1