From 0aa31108c48e7ed2257347f1412e8c1e023d2d97 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 17 Oct 2016 13:54:07 -0400 Subject: [PATCH] Make sure we apply when update buttons is called in new edit dialog. Change-Id: I8a31af7d0700ac285ecaa30d2a884b45d439f46f --- .../ui/internal/LaunchBarLaunchConfigDialog.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java index b5a677a49b8..1dd932579a9 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/LaunchBarLaunchConfigDialog.java @@ -36,6 +36,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau private ILaunchConfigurationTabGroup group; private CTabFolder tabFolder; private CTabItem lastSelection; + private boolean initing; public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy, ILaunchDescriptor descriptor, ILaunchMode mode, ILaunchTarget target) { @@ -55,6 +56,8 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override protected Control createDialogArea(Composite parent) { + initing = true; + // create the top level composite for the dialog area Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -132,6 +135,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau Activator.log(e.getStatus()); } + initing = false; return composite; } @@ -150,7 +154,16 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau @Override public void updateButtons() { - // TODO + // Lots of tabs want to be applied when this is called + if (!initing) { + ILaunchConfigurationTab[] tabs = getTabs(); + if (tabFolder != null && tabs != null) { + int pageIndex = tabFolder.getSelectionIndex(); + if (pageIndex >= 0) { + tabs[pageIndex].performApply(workingCopy); + } + } + } } @Override