// Prompt for new driver instance
if (driverInstance == null) {
TemplateDescriptor[] templates = TemplateDescriptor.getDriverTemplateDescriptors();
TemplateDescriptor driverTemplate = null;
if (templates != null) {
for (TemplateDescriptor temp : templates) {
String templateID = temp.getId();
if (templateID.contains(descriptor.getDriverTemplateIdentifier())) {
driverTemplate = temp;
break;
}
}
}
if (driverTemplate != null) {
IPropertySet properties = new PropertySetImpl(descriptor.getDriverName(), driverTemplate.getName());
Properties props = new Properties();
props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, Messages.DataToolsTunnelAction_PROP_REPLACE);
props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, driverTemplate.getId());
// Must set the properties as the driver dialogue
// throws exceptions if all properties are not set with
// values
// Properties get set again later regardless if a driver
// instance
// was created or not
setProperties(props, tunnelDescriptor);
properties.setBaseProperties(props);
Shell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
if (shell != null) {
DriverDialog jdbcDriverDialog = new DriverDialog(shell, driverTemplate.getParentCategory());
jdbcDriverDialog.setPropertySet(properties);
jdbcDriverDialog.setEditMode(true);
jdbcDriverDialog.setIsEditable(true);