From 243967728acb1630a8f05e405b514cba20a30774 Mon Sep 17 00:00:00 2001 From: serge-rider Date: Thu, 3 May 2018 15:50:11 +0300 Subject: [PATCH] Debug panel UI fix --- .../ui/DatabaseDebugConfigurationTab.java | 8 ++++--- .../internal/PostgreDebugPanelFunction.java | 22 ++++++++++++------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java b/plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java index d7df719428..222480b901 100644 --- a/plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java +++ b/plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseDebugConfigurationTab.java @@ -95,8 +95,9 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa protected void onDataSourceChange(DBPDataSourceContainer dataSource) { String driverName = dataSource == null ? "" : dataSource.getDriver().getFullName(); driverText.setText(driverName); + setDirty(true); loadConnectionDebugTypes(); - scheduleUpdateJob(); + updateLaunchConfigurationDialog(); } }; connectionCombo.addItem(null); @@ -138,8 +139,8 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa @Override public void widgetSelected(SelectionEvent e) { if (typeSelector.getSelection()) { + setDirty(true); setDebugType(connectionCombo.getSelectedItem(), (DebugConfigurationPanelDescriptor) typeSelector.getData()); - updateLaunchConfigurationDialog(); } } }); @@ -223,7 +224,7 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa } catch (CoreException e) { setWarningMessage("Error loading debug configuration: " + e.getMessage()); } - updateLaunchConfigurationDialog(); + scheduleUpdateJob(); } @Override @@ -283,4 +284,5 @@ public class DatabaseDebugConfigurationTab extends AbstractLaunchConfigurationTa public boolean canSave() { return connectionCombo.getSelectedItem() != null && selectedDebugType != null; } + } diff --git a/plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java b/plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java index 8d9e9a0a5a..77b8e07128 100644 --- a/plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java +++ b/plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java @@ -20,9 +20,7 @@ package org.jkiss.dbeaver.ext.postgresql.debug.ui.internal; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.*; import org.jkiss.dbeaver.debug.ui.DBGConfigurationPanel; import org.jkiss.dbeaver.ext.postgresql.debug.PostgreDebugConstants; import org.jkiss.dbeaver.model.DBPDataSourceContainer; @@ -34,21 +32,29 @@ public class PostgreDebugPanelFunction implements DBGConfigurationPanel { private Button kindLocal; private Button kindGlobal; + private Combo functionText; + private Text processIdText; @Override public void createPanel(Composite parent) { { - UIUtils.createControlGroup(parent, "Attach type", 2, GridData.FILL_HORIZONTAL, SWT.DEFAULT); - kindLocal = new Button(parent, SWT.RADIO); + Group kindGroup = UIUtils.createControlGroup(parent, "Attach type", 2, GridData.HORIZONTAL_ALIGN_BEGINNING, SWT.DEFAULT); + kindLocal = new Button(kindGroup, SWT.RADIO); kindLocal.setText("Local"); - kindGlobal = new Button(parent, SWT.RADIO); + kindGlobal = new Button(kindGroup, SWT.RADIO); kindGlobal.setText("Global"); } { Group functionGroup = UIUtils.createControlGroup(parent, "Function", 2, GridData.VERTICAL_ALIGN_BEGINNING, SWT.DEFAULT); - UIUtils.createLabelText(functionGroup, "Function", "", SWT.BORDER | SWT.READ_ONLY, new GridData(GridData.FILL_HORIZONTAL)); + functionText = UIUtils.createLabelCombo(functionGroup, "Function", "", SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); + GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); + gd.widthHint = UIUtils.getFontHeight(functionText) * 40 + 10; + functionText.setLayoutData(gd); - UIUtils.createLabelText(functionGroup, "Process ID", "", SWT.BORDER | SWT.READ_ONLY, new GridData(GridData.FILL_HORIZONTAL)); + processIdText = UIUtils.createLabelText(functionGroup, "Process ID", "", SWT.BORDER, new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); + gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); + gd.widthHint = UIUtils.getFontHeight(functionText) * 10 + 10; + processIdText.setLayoutData(gd); } } -- GitLab