use of net.sourceforge.sqlexplorer.dbproduct.ManagedDriver in project tdq-studio-se by Talend.
the class CreateAliasDlg method populateCombo.
private void populateCombo() {
String previous = cboDriver.getText();
if (previous != null) {
previous = previous.trim();
if (previous.length() == 0)
previous = null;
}
if (previous != null)
previous = previous.toLowerCase();
DriverManager driverModel = SQLExplorerPlugin.getDefault().getDriverModel();
cboDriver.removeAll();
TreeSet<ManagedDriver> drivers = new TreeSet<ManagedDriver>();
drivers.addAll(driverModel.getDrivers());
int index = 0;
for (ManagedDriver driver : drivers) {
try {
driver.registerSQLDriver();
} catch (ClassNotFoundException e) {
// Nothing
}
if (driver.isDriverClassLoaded() == true) {
cboDriver.add(driver.getName());
comboDriverIndexes.put(new Integer(index), driver);
if (previous != null && driver.getName().toLowerCase().startsWith(previous))
cboDriver.select(index);
index++;
}
}
}
Aggregations