Search in sources :

Example 1 with RemoteNativeClientLocation

use of org.jkiss.dbeaver.registry.driver.RemoteNativeClientLocation in project dbeaver by dbeaver.

the class ClientHomesPanel method loadHomes.

public void loadHomes(DBPDriver driver) {
    homesTable.removeAll();
    this.driver = driver;
    selectHome(null);
    DBPNativeClientLocationManager clientManager = this.driver.getNativeClientManager();
    if (clientManager == null) {
        // $NON-NLS-1$ //$NON-NLS-2$
        log.debug("Client manager is not supported by driver '" + driver.getName() + "'");
    }
    Set<DBPNativeClientLocation> providedHomes = new LinkedHashSet<>();
    if (clientManager != null) {
        providedHomes.addAll(clientManager.findLocalClientLocations());
    }
    Set<DBPNativeClientLocation> allHomes = new LinkedHashSet<>();
    allHomes.addAll(driver.getNativeClientLocations());
    allHomes.addAll(providedHomes);
    for (DBPNativeClientLocation home : allHomes) {
        TableItem item = createHomeItem(clientManager, home, home instanceof RemoteNativeClientLocation || providedHomes.contains(home));
        if (item != null) {
            HomeInfo homeInfo = (HomeInfo) item.getData();
            if (homeInfo.isDefault) {
                homesTable.setSelection(homesTable.indexOf(item));
                selectHome(homeInfo);
            }
        }
    }
}
Also used : DBPNativeClientLocationManager(org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager) DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) RemoteNativeClientLocation(org.jkiss.dbeaver.registry.driver.RemoteNativeClientLocation)

Example 2 with RemoteNativeClientLocation

use of org.jkiss.dbeaver.registry.driver.RemoteNativeClientLocation in project dbeaver by serge-rider.

the class ClientHomesPanel method loadHomes.

public void loadHomes(DBPDriver driver) {
    homesTable.removeAll();
    this.driver = driver;
    selectHome(null);
    DBPNativeClientLocationManager clientManager = this.driver.getNativeClientManager();
    if (clientManager == null) {
        // $NON-NLS-1$ //$NON-NLS-2$
        log.debug("Client manager is not supported by driver '" + driver.getName() + "'");
    }
    Set<DBPNativeClientLocation> providedHomes = new LinkedHashSet<>();
    if (clientManager != null) {
        providedHomes.addAll(clientManager.findLocalClientLocations());
    }
    Set<DBPNativeClientLocation> allHomes = new LinkedHashSet<>();
    allHomes.addAll(driver.getNativeClientLocations());
    allHomes.addAll(providedHomes);
    for (DBPNativeClientLocation home : allHomes) {
        TableItem item = createHomeItem(clientManager, home, home instanceof RemoteNativeClientLocation || providedHomes.contains(home));
        if (item != null) {
            HomeInfo homeInfo = (HomeInfo) item.getData();
            if (homeInfo.isDefault) {
                homesTable.setSelection(homesTable.indexOf(item));
                selectHome(homeInfo);
            }
        }
    }
}
Also used : DBPNativeClientLocationManager(org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager) DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) RemoteNativeClientLocation(org.jkiss.dbeaver.registry.driver.RemoteNativeClientLocation)

Aggregations

DBPNativeClientLocation (org.jkiss.dbeaver.model.connection.DBPNativeClientLocation)2 DBPNativeClientLocationManager (org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager)2 RemoteNativeClientLocation (org.jkiss.dbeaver.registry.driver.RemoteNativeClientLocation)2