Search in sources :

Example 1 with LocalNativeClientLocation

use of org.jkiss.dbeaver.model.connection.LocalNativeClientLocation in project dbeaver by serge-rider.

the class ClientHomesPanel method addClientHome.

private void addClientHome() {
    DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
    if (lastHomeDirectory != null) {
        directoryDialog.setFilterPath(lastHomeDirectory);
    }
    String homeId = directoryDialog.open();
    if (homeId == null) {
        return;
    }
    lastHomeDirectory = homeId;
    DBPNativeClientLocationManager clientManager = driver.getNativeClientManager();
    if (clientManager != null) {
        createHomeItem(clientManager, new LocalNativeClientLocation(homeId, homeId), false);
    }
}
Also used : DBPNativeClientLocationManager(org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

Example 2 with LocalNativeClientLocation

use of org.jkiss.dbeaver.model.connection.LocalNativeClientLocation in project dbeaver by dbeaver.

the class AbstractNativeToolWizard method updateErrorMessage.

void updateErrorMessage() {
    WizardPage currentPage = (WizardPage) getStartingPage();
    if (isNativeClientHomeRequired()) {
        String clientHomeId = getSettings().getDataSourceContainer().getConnectionConfiguration().getClientHomeId();
        List<DBPNativeClientLocation> nativeClientLocations = getSettings().getDataSourceContainer().getDriver().getNativeClientLocations();
        if (CommonUtils.isEmpty(clientHomeId)) {
            if (nativeClientLocations != null && !nativeClientLocations.isEmpty()) {
                settings.setClientHome(nativeClientLocations.get(0));
            } else {
                settings.setClientHome(null);
            }
            if (settings.getClientHome() == null) {
                currentPage.setErrorMessage(TaskNativeUIMessages.tools_wizard_message_no_client_home);
                getContainer().updateMessage();
                return;
            }
        } else {
            DBPNativeClientLocation clientHome = DBUtils.findObject(nativeClientLocations, clientHomeId);
            if (clientHome == null) {
                clientHome = getSettings().findNativeClientHome(clientHomeId);
            }
            if (clientHome == null) {
                // Make local client home from location
                clientHome = new LocalNativeClientLocation(clientHomeId, clientHomeId);
            }
            settings.setClientHome(clientHome);
        }
        if (settings.getClientHome() == null) {
            currentPage.setErrorMessage(NLS.bind(TaskNativeUIMessages.tools_wizard_message_client_home_not_found, clientHomeId));
        } else {
            currentPage.setErrorMessage(null);
        }
        getContainer().updateMessage();
    }
}
Also used : DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) WizardPage(org.eclipse.jface.wizard.WizardPage) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

Example 3 with LocalNativeClientLocation

use of org.jkiss.dbeaver.model.connection.LocalNativeClientLocation in project dbeaver by serge-rider.

the class AbstractNativeToolWizard method updateErrorMessage.

void updateErrorMessage() {
    WizardPage currentPage = (WizardPage) getStartingPage();
    if (isNativeClientHomeRequired()) {
        String clientHomeId = getSettings().getDataSourceContainer().getConnectionConfiguration().getClientHomeId();
        List<DBPNativeClientLocation> nativeClientLocations = getSettings().getDataSourceContainer().getDriver().getNativeClientLocations();
        if (CommonUtils.isEmpty(clientHomeId)) {
            if (nativeClientLocations != null && !nativeClientLocations.isEmpty()) {
                settings.setClientHome(nativeClientLocations.get(0));
            } else {
                settings.setClientHome(null);
            }
            if (settings.getClientHome() == null) {
                currentPage.setErrorMessage(TaskNativeUIMessages.tools_wizard_message_no_client_home);
                getContainer().updateMessage();
                return;
            }
        } else {
            DBPNativeClientLocation clientHome = DBUtils.findObject(nativeClientLocations, clientHomeId);
            if (clientHome == null) {
                clientHome = getSettings().findNativeClientHome(clientHomeId);
            }
            if (clientHome == null) {
                // Make local client home from location
                clientHome = new LocalNativeClientLocation(clientHomeId, clientHomeId);
            }
            settings.setClientHome(clientHome);
        }
        if (settings.getClientHome() == null) {
            currentPage.setErrorMessage(NLS.bind(TaskNativeUIMessages.tools_wizard_message_client_home_not_found, clientHomeId));
        } else {
            currentPage.setErrorMessage(null);
        }
        getContainer().updateMessage();
    }
}
Also used : DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) WizardPage(org.eclipse.jface.wizard.WizardPage) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

Example 4 with LocalNativeClientLocation

use of org.jkiss.dbeaver.model.connection.LocalNativeClientLocation in project dbeaver by dbeaver.

the class ClientHomesPanel method addClientHome.

private void addClientHome() {
    DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
    if (lastHomeDirectory != null) {
        directoryDialog.setFilterPath(lastHomeDirectory);
    }
    String homeId = directoryDialog.open();
    if (homeId == null) {
        return;
    }
    lastHomeDirectory = homeId;
    DBPNativeClientLocationManager clientManager = driver.getNativeClientManager();
    if (clientManager != null) {
        createHomeItem(clientManager, new LocalNativeClientLocation(homeId, homeId), false);
    }
}
Also used : DBPNativeClientLocationManager(org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

Aggregations

LocalNativeClientLocation (org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)4 WizardPage (org.eclipse.jface.wizard.WizardPage)2 DBPNativeClientLocation (org.jkiss.dbeaver.model.connection.DBPNativeClientLocation)2 DBPNativeClientLocationManager (org.jkiss.dbeaver.model.connection.DBPNativeClientLocationManager)2