提交 cab0f979 编写于 作者: S serge-rider

Driver management fix

上级 0f71a680
......@@ -186,13 +186,6 @@ public class DriverEditDialog extends HelpEnabledDialog {
Group propsGroup = UIUtils.createControlGroup(group, CoreMessages.dialog_edit_driver_setting, 4, -1, -1);
propsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (!newDriver) {
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gd.horizontalSpan = 3;
Text idText = UIUtils.createLabelText(propsGroup, "ID", driver.getId(), SWT.BORDER | SWT.READ_ONLY, gd);
idText.setToolTipText("Internal driver ID.\nCan be used in connections configurations and CLI commands.");
}
gd = new GridData(GridData.FILL_HORIZONTAL);
driverNameText = UIUtils.createLabelText(propsGroup, CoreMessages.dialog_edit_driver_label_driver_name + "*", driver.getName(), SWT.BORDER | advStyle, gd);
driverNameText.addModifyListener(new ModifyListener() {
......@@ -269,7 +262,7 @@ public class DriverEditDialog extends HelpEnabledDialog {
}
{
Group infoGroup = UIUtils.createControlGroup(group, CoreMessages.dialog_edit_driver_description, 2, -1, -1);
Group infoGroup = UIUtils.createControlGroup(group, CoreMessages.dialog_edit_driver_description, 4, -1, -1);
infoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
driverCategoryCombo = UIUtils.createLabelCombo(infoGroup, CoreMessages.dialog_edit_driver_label_category, SWT.BORDER | SWT.DROP_DOWN | advStyle);
......@@ -295,7 +288,16 @@ public class DriverEditDialog extends HelpEnabledDialog {
driverCategoryCombo.setText(defaultCategory);
}
{
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING);
Text idText = UIUtils.createLabelText(infoGroup, "ID", driver.getId(), SWT.BORDER | SWT.READ_ONLY, gd);
idText.setToolTipText("Internal driver ID.\nCan be used in connections configurations and CLI commands.");
}
driverDescText = UIUtils.createLabelText(infoGroup, CoreMessages.dialog_edit_driver_label_description, CommonUtils.notEmpty(driver.getDescription()), SWT.BORDER | advStyle);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
driverDescText.setLayoutData(gd);
if (!CommonUtils.isEmpty(driver.getWebURL())) {
UIUtils.createControlLabel(infoGroup, CoreMessages.dialog_edit_driver_label_website);
......@@ -305,7 +307,10 @@ public class DriverEditDialog extends HelpEnabledDialog {
UIUtils.launchProgram(driver.getWebURL());
}
});
urlLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
driverDescText.setLayoutData(gd);
urlLabel.setLayoutData(gd);
}
}
......
......@@ -24,6 +24,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
import org.jkiss.dbeaver.core.DBeaverUI;
import org.jkiss.dbeaver.registry.DataSourceProviderDescriptor;
import java.util.List;
......@@ -56,7 +57,8 @@ public class DriverTreeControl extends FilteredTree {
Object[] initData = (Object[]) getParent().getData(DRIVER_INIT_DATA);
parent.setData(DRIVER_INIT_DATA, null);
DriverTreeViewer viewer = new DriverTreeViewer(parent, style);
viewer.initDrivers(initData[0], (List<DataSourceProviderDescriptor>) initData[1], (Boolean) initData[2]);
DBeaverUI.asyncExec(() ->
viewer.initDrivers(initData[0], (List<DataSourceProviderDescriptor>) initData[1], (Boolean) initData[2]));
return viewer;
}
......
......@@ -154,22 +154,7 @@ public class DriverTreeViewer extends TreeViewer implements ISelectionChangedLis
Collection<Object> drivers = collectDrivers();
this.setInput(drivers);
this.expandAll();
getTree().addListener(SWT.Resize, new Listener() {
volatile boolean resizing = false;
@Override
public void handleEvent(Event event) {
if (resizing) {
return;
}
resizing = true;
try {
UIUtils.packColumns(getTree(), true, new float[] {0.9f, 0.1f});
} finally {
resizing = false;
}
}
});
UIUtils.packColumns(getTree(), true, new float[] {0.9f, 0.1f});
if (expandRecent) {
// Expand used driver categories
......@@ -188,7 +173,9 @@ public class DriverTreeViewer extends TreeViewer implements ISelectionChangedLis
@Override
public void refresh()
{
collectDrivers();
if (providers != null) {
collectDrivers();
}
super.refresh();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册