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);
}
}
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();
}
}
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();
}
}
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);
}
}
Aggregations