提交 75f65590 编写于 作者: J jurgen

Maven model & ui

Former-commit-id: 41731321
上级 ba284b45
......@@ -31,9 +31,7 @@ import org.jkiss.utils.CommonUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.*;
/**
* DriverLibraryDescriptor
......@@ -44,8 +42,6 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
public static final String PATH_PREFIX = "maven:/";
private List<DriverLibraryMavenDependency> dependencies;
public DriverLibraryMavenArtifact(DriverDescriptor driver, FileType type, String path) {
super(driver, type, path);
}
......@@ -114,7 +110,7 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
// In case of local artifact make version resolve
MavenArtifactReference artifactInfo = new MavenArtifactReference(path);
try {
localVersion = artifact.resolveVersion(VoidProgressMonitor.INSTANCE, artifactInfo.getVersion());
localVersion = artifact.resolveVersion(VoidProgressMonitor.INSTANCE, artifactInfo.getVersion(), true);
} catch (IOException e) {
log.warn("Error resolving local artifact [" + artifact + "] version", e);
}
......@@ -129,32 +125,40 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
@Nullable
@Override
public Collection<? extends DBPDriverLibrary> getDependencies(DBRProgressMonitor monitor) throws IOException {
if (dependencies == null) {
dependencies = new ArrayList<>();
MavenLocalVersion localVersion = resolveLocalVersion(monitor, false);
if (localVersion != null) {
collectDependencies(monitor, localVersion);
}
}
return dependencies;
}
private void collectDependencies(DBRProgressMonitor monitor, MavenLocalVersion localVersion) throws IOException {
MavenArtifactVersion metaData = localVersion.getMetaData(monitor);
if (metaData != null) {
List<MavenArtifactDependency> dependencies = metaData.getDependencies();
if (!CommonUtils.isEmpty(dependencies)) {
for (MavenArtifactDependency dependency : dependencies) {
MavenArtifact depArtifact = MavenRegistry.getInstance().findArtifact(dependency.getArtifactReference());
if (depArtifact != null) {
MavenLocalVersion depLocalVersion = depArtifact.resolveVersion(monitor, dependency.getArtifactReference().getVersion());
if (depLocalVersion != null) {
this.dependencies.add(new DriverLibraryMavenDependency(this.getDriver(), depLocalVersion));
List<DriverLibraryMavenDependency> dependencies = new ArrayList<>();
MavenLocalVersion localVersion = resolveLocalVersion(monitor, false);
if (localVersion != null) {
MavenArtifactVersion metaData = localVersion.getMetaData(monitor);
if (metaData != null) {
List<MavenArtifactDependency> artifactDeps = metaData.getDependencies();
if (!CommonUtils.isEmpty(artifactDeps)) {
for (MavenArtifactDependency artifactDep : artifactDeps) {
if (artifactDep.isOptional()) {
continue;
}
switch (artifactDep.getScope()) {
case COMPILE:
case RUNTIME:
{
MavenLocalVersion depLocalVersion = artifactDep.resolveDependency(monitor);
if (depLocalVersion != null) {
dependencies.add(
new DriverLibraryMavenDependency(
this.getDriver(),
depLocalVersion));
}
break;
}
default:
// We don't need it
break;
}
}
}
}
}
return dependencies;
}
@NotNull
......@@ -200,7 +204,7 @@ public class DriverLibraryMavenArtifact extends DriverLibraryAbstract
return localVersion;
}
}
return artifact.resolveVersion(monitor, artifactInfo.getVersion());
return artifact.resolveVersion(monitor, artifactInfo.getVersion(), true);
}
}
......@@ -17,22 +17,14 @@
*/
package org.jkiss.dbeaver.registry.driver;
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBIcon;
import org.jkiss.dbeaver.model.DBPDriverLibrary;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.registry.maven.*;
import org.jkiss.dbeaver.ui.UIIcon;
import org.jkiss.dbeaver.registry.maven.MavenArtifact;
import org.jkiss.dbeaver.registry.maven.MavenLocalVersion;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* DriverLibraryDescriptor
......@@ -42,7 +34,7 @@ public class DriverLibraryMavenDependency extends DriverLibraryMavenArtifact
private MavenLocalVersion localVersion;
public DriverLibraryMavenDependency(DriverDescriptor driverDescriptor, MavenLocalVersion localVersion) {
super(driverDescriptor, FileType.jar, localVersion.getArtifact().toString());
super(driverDescriptor, FileType.jar, PATH_PREFIX + localVersion.toString());
this.localVersion = localVersion;
}
......
......@@ -53,6 +53,8 @@ public class MavenArtifact
private String releaseVersion;
private Date lastUpdate;
private transient boolean metadataLoaded = false;
private List<MavenLocalVersion> localVersions = new ArrayList<MavenLocalVersion>();
private String activeVersion;
......@@ -69,7 +71,7 @@ public class MavenArtifact
versions.clear();
lastUpdate = null;
String metadataPath = getArtifactDir() + MAVEN_METADATA_XML;
String metadataPath = getArtifactURL() + MAVEN_METADATA_XML;
monitor.subTask("Load artifact metadata [" + metadataPath + "]");
System.out.println("Load metadata " + this);
try (InputStream mdStream = RuntimeUtils.openConnectionStream(metadataPath)) {
......@@ -107,7 +109,10 @@ System.out.println("Load metadata " + this);
});
} catch (XMLException e) {
log.warn("Error parsing artifact metadata", e);
} finally {
monitor.worked(1);
}
metadataLoaded = true;
}
public MavenRepository getRepository() {
......@@ -150,13 +155,13 @@ System.out.println("Load metadata " + this);
this.activeVersion = activeVersion;
}
private String getArtifactDir() {
String dir = (groupId + "/" + artifactId).replace('.', '/');
private String getArtifactURL() {
String dir = groupId.replace('.', '/') + "/" + artifactId;
return repository.getUrl() + dir + "/";
}
public String getFileURL(String version, String fileType) {
return getArtifactDir() + version + "/" + getVersionFileName(version, fileType);
return getArtifactURL() + version + "/" + getVersionFileName(version, fileType);
}
@NotNull
......@@ -212,16 +217,13 @@ System.out.println("Load metadata " + this);
localVersions.remove(version);
}
public MavenLocalVersion resolveVersion(DBRProgressMonitor monitor, String versionRef) throws IOException {
monitor.beginTask("Download Maven artifact '" + this + "'", 3);
try {
monitor.subTask("Download metadata from " + repository.getUrl());
if (versions.isEmpty()) {
loadMetadata(monitor);
}
monitor.worked(1);
public MavenLocalVersion resolveVersion(DBRProgressMonitor monitor, String versionRef, boolean lookupVersion) throws IOException {
if (lookupVersion && !metadataLoaded) {
loadMetadata(monitor);
}
String versionInfo = versionRef;
String versionInfo = versionRef;
if (lookupVersion) {
List<String> allVersions = versions;
if (versionInfo.equals(MavenArtifactReference.VERSION_PATTERN_RELEASE)) {
versionInfo = releaseVersion;
......@@ -255,27 +257,23 @@ System.out.println("Load metadata " + this);
// Use latest version
versionInfo = findLatestVersion(allVersions);
}
monitor.subTask("Download binaries for version " + versionInfo);
MavenLocalVersion localVersion = getActiveLocalVersion();
if (localVersion == null) {
localVersion = makeLocalVersion(monitor, versionInfo, true);
}
monitor.worked(1);
monitor.subTask("Save repository cache");
repository.flushCache();
monitor.worked(1);
}
return localVersion;
} finally {
monitor.done();
MavenLocalVersion localVersion = getActiveLocalVersion();
if (localVersion == null) {
localVersion = makeLocalVersion(monitor, versionInfo, true);
}
repository.flushCache();
return localVersion;
}
private static boolean isBetaVersion(String versionInfo) {
return versionInfo.contains("beta") || versionInfo.contains("alpha");
}
private String findLatestVersion(List<String> allVersions) {
private static String findLatestVersion(List<String> allVersions) {
String latest = null;
for (String version : allVersions) {
if (isBetaVersion(version)) {
......@@ -288,7 +286,7 @@ System.out.println("Load metadata " + this);
return latest;
}
private int compareVersions(String v1, String v2) {
private static int compareVersions(String v1, String v2) {
StringTokenizer st1 = new StringTokenizer(v1, ".-_");
StringTokenizer st2 = new StringTokenizer(v2, ".-_");
while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
......
......@@ -17,36 +17,48 @@
*/
package org.jkiss.dbeaver.registry.maven;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import java.io.IOException;
/**
* Maven artifact license references
*/
public class MavenArtifactDependency
{
private MavenArtifactReference artifactReference;
private String type;
private boolean optional;
public class MavenArtifactDependency extends MavenArtifactReference {
public MavenArtifactDependency(MavenArtifactReference artifactReference, String type, boolean optional) {
this.artifactReference = artifactReference;
this.type = type;
this.optional = optional;
public enum Scope {
COMPILE,
PROVIDED,
RUNTIME,
TEST,
SYSTEM,
IMPORT
}
public MavenArtifactReference getArtifactReference() {
return artifactReference;
private Scope scope;
private boolean optional;
public MavenArtifactDependency(@NotNull String groupId, @NotNull String artifactId, @NotNull String version, Scope scope, boolean optional) {
super(groupId, artifactId, version);
this.scope = scope;
this.optional = optional;
}
public String getType() {
return type;
public Scope getScope() {
return scope;
}
public boolean isOptional() {
return optional;
}
@Override
public String toString() {
return artifactReference.toString() + ";type=" + type + "; optional=" + optional;
public MavenLocalVersion resolveDependency(DBRProgressMonitor monitor) throws IOException {
MavenArtifact depArtifact = MavenRegistry.getInstance().findArtifact(this);
if (depArtifact != null) {
return depArtifact.resolveVersion(monitor, getVersion(), false);
}
return null;
}
}
......@@ -17,6 +17,8 @@
*/
package org.jkiss.dbeaver.registry.maven;
import org.jkiss.code.NotNull;
/**
* Maven artifact reference
*/
......@@ -27,11 +29,14 @@ public class MavenArtifactReference
private static final String DEFAULT_MAVEN_VERSION = VERSION_PATTERN_RELEASE;
@NotNull
private String groupId;
@NotNull
private String artifactId;
@NotNull
private String version;
public MavenArtifactReference(String groupId, String artifactId, String version) {
public MavenArtifactReference(@NotNull String groupId, @NotNull String artifactId, @NotNull String version) {
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
......@@ -61,27 +66,30 @@ public class MavenArtifactReference
}
}
@NotNull
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
public void setGroupId(@NotNull String groupId) {
this.groupId = groupId;
}
@NotNull
public String getArtifactId() {
return artifactId;
}
public void setArtifactId(String artifactId) {
public void setArtifactId(@NotNull String artifactId) {
this.artifactId = artifactId;
}
@NotNull
public String getVersion() {
return version;
}
public void setVersion(String version) {
public void setVersion(@NotNull String version) {
this.version = version;
}
......@@ -94,4 +102,9 @@ public class MavenArtifactReference
public String toString() {
return getPath();
}
@Override
public int hashCode() {
return groupId.hashCode() + artifactId.hashCode() + version.hashCode();
}
}
......@@ -30,10 +30,7 @@ import org.w3c.dom.Element;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Maven artifact version descriptor (POM).
......@@ -133,7 +130,7 @@ public class MavenArtifactVersion {
private void loadPOM(DBRProgressMonitor monitor) throws IOException {
String pomURL = localVersion.getArtifact().getFileURL(localVersion.getVersion(), MavenArtifact.FILE_POM);
monitor.subTask("Load POM [" + pomURL + "]");
System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + version);
System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + localVersion.getVersion());
Document pomDocument;
try (InputStream mdStream = RuntimeUtils.openConnectionStream(pomURL)) {
pomDocument = XMLUtils.parseDocument(mdStream);
......@@ -149,19 +146,27 @@ System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + v
// Parent
Element parentElement = XMLUtils.getChildElement(root, "parent");
if (parentElement != null) {
parentReference = new MavenArtifactReference(
XMLUtils.getChildElementBody(parentElement, "groupId"),
XMLUtils.getChildElementBody(parentElement, "artifactId"),
XMLUtils.getChildElementBody(parentElement, "version")
);
if (version == null) {
version = parentReference.getVersion();
}
MavenArtifact parentArtifact = MavenRegistry.getInstance().findArtifact(parentReference);
if (parentArtifact == null) {
log.error("Artifact [" + this + "] parent [" + parentReference + "] not found");
String parentGroupId = XMLUtils.getChildElementBody(parentElement, "groupId");
String parentArtifactId = XMLUtils.getChildElementBody(parentElement, "artifactId");
String parentVersion = XMLUtils.getChildElementBody(parentElement, "version");
if (parentGroupId == null || parentArtifactId == null || parentVersion == null) {
log.error("Broken parent reference: " + parentGroupId + ":" + parentArtifactId + ":" + parentVersion);
} else {
parent = parentArtifact.resolveVersion(monitor, parentReference.getVersion());
parentReference = new MavenArtifactReference(
parentGroupId,
parentArtifactId,
parentVersion
);
if (this.version == null) {
this.version = parentReference.getVersion();
}
// parent = MavenRegistry.getInstance().findArtifactVersion(parentReference);
MavenArtifact parentArtifact = MavenRegistry.getInstance().findArtifact(parentReference);
if (parentArtifact == null) {
log.error("Artifact [" + this + "] parent [" + parentReference + "] not found");
} else {
parent = parentArtifact.resolveVersion(monitor, parentReference.getVersion(), false);
}
}
}
}
......@@ -195,6 +200,7 @@ System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + v
}
dependencies = parseDependencies(monitor, root);
}
monitor.worked(1);
}
private List<MavenArtifactDependency> parseDependencies(DBRProgressMonitor monitor, Element element) {
......@@ -204,22 +210,28 @@ System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + v
for (Element dep : XMLUtils.getChildElementList(dependenciesElement, "dependency")) {
String groupId = XMLUtils.getChildElementBody(dep, "groupId");
String artifactId = XMLUtils.getChildElementBody(dep, "artifactId");
if (groupId == null || artifactId == null) {
log.warn("Broken dependency reference: " + groupId + ":" + artifactId);
continue;
}
String version = XMLUtils.getChildElementBody(dep, "version");
if (CommonUtils.isEmpty(version)) {
if (version == null) {
version = findDependencyVersion(monitor, groupId, artifactId);
}
if (version == null) {
log.error("Can't resolve artifact [" + groupId + ":" + artifactId + "] version. Skip.");
continue;
}
MavenArtifactReference depRef = new MavenArtifactReference(
MavenArtifactDependency.Scope scope = MavenArtifactDependency.Scope.COMPILE;
String scopeName = XMLUtils.getChildElementBody(dep, "scope");
if (!CommonUtils.isEmpty(scopeName)) {
scope = MavenArtifactDependency.Scope.valueOf(scopeName.toUpperCase(Locale.ENGLISH));
}
result.add(new MavenArtifactDependency(
groupId,
artifactId,
evaluateString(version)
);
result.add(new MavenArtifactDependency(
depRef,
XMLUtils.getChildElementBody(dep, "type"),
evaluateString(version),
scope,
CommonUtils.getBoolean(XMLUtils.getChildElementBody(dep, "optional"), false)
));
}
......@@ -230,10 +242,10 @@ System.out.println("Load POM " + localVersion.getArtifact().toString() + ":" + v
private String findDependencyVersion(DBRProgressMonitor monitor, String groupId, String artifactId) {
if (dependencyManagement != null) {
for (MavenArtifactDependency dmArtifact : dependencyManagement) {
if (dmArtifact.getArtifactReference().getGroupId().equals(groupId) &&
dmArtifact.getArtifactReference().getArtifactId().equals(artifactId))
if (dmArtifact.getGroupId().equals(groupId) &&
dmArtifact.getArtifactId().equals(artifactId))
{
return dmArtifact.getArtifactReference().getVersion();
return dmArtifact.getVersion();
}
}
}
......
......@@ -94,7 +94,7 @@ public class MavenLocalVersion
@Override
public String toString() {
return artifact.toString() + ":" + version + ":" + fileName;
return artifact.toString() + ":" + version;
}
}
......@@ -131,6 +131,27 @@ public class MavenRegistry
return null;
}
/*
@Nullable
public MavenLocalVersion findArtifactVersion(@NotNull MavenArtifactReference ref) {
String fullId = ref.getGroupId() + ":" + ref.getArtifactId();
if (notFoundArtifacts.contains(fullId)) {
return null;
}
MavenLocalVersion version = findInRepositories(groupId, artifactId, false);
if (version == null) {
version = findInRepositories(groupId, artifactId, true);
}
if (version != null) {
return version;
}
// Not found
notFoundArtifacts.add(fullId);
return null;
}
*/
public void resetArtifactInfo(MavenArtifactReference artifactReference) {
String groupId = artifactReference.getGroupId();
String artifactId = artifactReference.getArtifactId();
......
......@@ -68,6 +68,8 @@ public class MavenRepository
private boolean local;
private boolean predefined = false;
private transient volatile boolean needsToSave = false;
private List<MavenArtifact> cachedArtifacts = new ArrayList<MavenArtifact>();
public MavenRepository(IConfigurationElement config)
......@@ -90,7 +92,7 @@ public class MavenRepository
}
public void flushCache() {
saveCache();
needsToSave = true;
}
public String getId() {
......
......@@ -17,11 +17,9 @@
*/
package org.jkiss.dbeaver.ui.dialogs.driver;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
......@@ -29,7 +27,6 @@ import org.jkiss.dbeaver.model.DBPDriverLibrary;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.DBRRunnableContext;
import org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.registry.driver.DriverDescriptor;
import org.jkiss.dbeaver.runtime.RunnableContextDelegate;
import org.jkiss.dbeaver.ui.DBeaverIcons;
......@@ -38,7 +35,7 @@ import org.jkiss.dbeaver.utils.GeneralUtils;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.*;
import java.util.List;
class DriverDownloadAutoPage extends DriverDownloadPage {
......@@ -69,10 +66,10 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
{
Group filesGroup = UIUtils.createControlGroup(composite, "Files required by driver", 1, -1, -1);
filesGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
filesGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
filesTree = new Tree(filesGroup, SWT.BORDER | SWT.FULL_SELECTION);
filesTree.setHeaderVisible(true);
filesTree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
filesTree.setLayoutData(new GridData(GridData.FILL_BOTH));
UIUtils.createTreeColumn(filesTree, SWT.LEFT, "File");
UIUtils.createTreeColumn(filesTree, SWT.LEFT, "Version");
}
......@@ -90,16 +87,20 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
@Override
void resolveLibraries() {
final Map<String, List<DBPDriverLibrary>> depMap = new LinkedHashMap<>();
try {
new RunnableContextDelegate(getContainer()).run(true, true, new DBRRunnableWithProgress() {
@Override
public void run(DBRProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Resolve dependencies", 100);
try {
for (DBPDriverLibrary library : getWizard().getFiles()) {
resolveDependencies(monitor, library);
resolveDependencies(monitor, library, depMap);
}
} catch (IOException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
});
......@@ -109,26 +110,47 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
UIUtils.showErrorDialog(null, "Resolve libraries", "Error resolving driver libraries", e.getTargetException());
}
int totalItems = 0;
for (DBPDriverLibrary file : getWizard().getFiles()) {
TreeItem item = new TreeItem(filesTree, SWT.NONE);
item.setImage(DBeaverIcons.getImage(file.getIcon()));
item.setText(0, file.getDisplayName());
item.setText(1, "");
totalItems++;
if (addDependencies(item, file, depMap)) {
item.setExpanded(true);
totalItems += item.getItemCount();
}
}
UIUtils.packColumns(filesTree);
// GridData gd = (GridData)filesTree.getLayoutData();
// gd.heightHint = filesTree.getItemCount() * 20 + 20;
Shell shell = getContainer().getShell();
shell.setSize(shell.getSize().x, shell.getSize().y + filesTree.getItemHeight() * totalItems);
shell.layout();
}
private void resolveDependencies(DBRProgressMonitor monitor, DBPDriverLibrary library) throws IOException {
private void resolveDependencies(DBRProgressMonitor monitor, DBPDriverLibrary library, Map<String, List<DBPDriverLibrary>> depMap) throws IOException {
String libraryPath = library.getPath();
List<DBPDriverLibrary> deps = depMap.get(libraryPath);
if (deps != null) {
return;
}
System.out.println("Resolve dependencies of [" + libraryPath + "]");
deps = new ArrayList<>();
depMap.put(libraryPath, deps);
Collection<? extends DBPDriverLibrary> dependencies = library.getDependencies(monitor);
if (dependencies != null && !dependencies.isEmpty()) {
for (DBPDriverLibrary dep : dependencies) {
resolveDependencies(monitor, dep);
deps.add(dep);
resolveDependencies(monitor, dep, depMap);
}
}
}
private void addDependencies(TreeItem parent, DBPDriverLibrary library) throws IOException {
Collection<? extends DBPDriverLibrary> dependencies = library.getDependencies(VoidProgressMonitor.INSTANCE);
private boolean addDependencies(TreeItem parent, DBPDriverLibrary library, Map<String, List<DBPDriverLibrary>> depMap) {
Collection<? extends DBPDriverLibrary> dependencies = depMap.get(library.getPath());
if (dependencies != null && !dependencies.isEmpty()) {
for (DBPDriverLibrary dep : dependencies) {
TreeItem item = new TreeItem(parent, SWT.NONE);
......@@ -136,9 +158,13 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
item.setText(0, dep.getDisplayName());
item.setText(1, "");
addDependencies(item, dep);
if (addDependencies(item, dep, depMap)) {
//item.setExpanded(true);
}
}
return true;
}
return false;
}
@Override
......
......@@ -49,8 +49,13 @@ public class DriverDownloadDialog extends WizardDialog
getWizard().init(DBeaverUI.getActiveWorkbenchWindow().getWorkbench(), null);
addPageChangedListener(new IPageChangedListener() {
@Override
public void pageChanged(PageChangedEvent event) {
getWizard().pageActivated(event.getSelectedPage());
public void pageChanged(final PageChangedEvent event) {
UIUtils.runInDetachedUI(getShell(), new Runnable() {
@Override
public void run() {
getWizard().pageActivated(event.getSelectedPage());
}
});
}
});
}
......
......@@ -47,7 +47,7 @@ abstract class DriverDownloadPage extends WizardPage {
protected void createLinksPanel(Composite composite) {
final DriverDescriptor driver = getWizard().getDriver();
UIUtils.createPlaceholder(composite, 1).setLayoutData(new GridData(GridData.FILL_BOTH));
//UIUtils.createPlaceholder(composite, 1).setLayoutData(new GridData(GridData.FILL_BOTH));
Composite linksGroup = UIUtils.createPlaceholder(composite, 2);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册