use of org.jkiss.dbeaver.runtime.RunnableContextDelegate in project dbeaver by serge-rider.
the class DriverDownloadAutoPage method createControl.
@Override
public void createControl(Composite parent) {
final DriverDownloadWizard wizard = getWizard();
final DriverDescriptor driver = wizard.getDriver();
setMessage("Download " + driver.getFullName() + " driver files");
initializeDialogUnits(parent);
Composite composite = UIUtils.createPlaceholder(parent, 1);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
if (!wizard.isForceDownload()) {
Composite infoGroup = UIUtils.createPlaceholder(composite, 2, 5);
infoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label infoText = new Label(infoGroup, SWT.NONE);
infoText.setText(driver.getFullName() + " driver files are missing.\nDBeaver can download these files automatically.\n\n");
infoText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final Button forceCheckbox = UIUtils.createCheckbox(infoGroup, "Force download / overwrite", wizard.isForceDownload());
forceCheckbox.setToolTipText("Force files download. Will download files even if they are already on the disk");
forceCheckbox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_BEGINNING));
forceCheckbox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
wizard.setForceDownload(forceCheckbox.getSelection());
}
});
}
{
Group filesGroup = UIUtils.createControlGroup(composite, "Files required by driver", 1, -1, -1);
filesGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
depsTree = new DriverDependenciesTree(filesGroup, new RunnableContextDelegate(getContainer()), getWizard().getDependencies(), driver, driver.getDriverLibraries(), true) {
protected void setLibraryVersion(final DBPDriverLibrary library, final String version) {
String curVersion = library.getVersion();
if (CommonUtils.equalObjects(curVersion, version)) {
return;
}
library.setPreferredVersion(version);
resolveLibraries();
}
};
new Label(filesGroup, SWT.NONE).setText("You can change driver version by clicking on version column.\nThen you can choose one of the available versions.");
}
if (!wizard.isForceDownload()) {
Label infoText = new Label(composite, SWT.NONE);
infoText.setText("\nOr you can obtain driver files by yourself and add them in driver editor.");
infoText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
createLinksPanel(composite);
setControl(composite);
}
Aggregations