From 0d5c33c51479e7632b0726926aa2819154cc5b0e Mon Sep 17 00:00:00 2001 From: Deepika Udayagiri Date: Thu, 4 Apr 2024 19:14:31 +0530 Subject: [PATCH] testFirstTabIsActivatedByDefault is no more passing with SWT fix under issue https://github.com/eclipse-platform/eclipse.platform.swt/issues/46 Fixes https://github.com/eclipse-platform/eclipse.platform/issues/1239 --- .../LaunchConfigurationTabGroupViewer.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java index 1f6b05506b6..a8d5180da8d 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java @@ -1183,10 +1183,7 @@ public boolean canSave() { * @return if the dialog can launch in its current state */ public boolean canLaunch() { - if(fInitializingTabs) { - return false; - } - if (getWorkingCopy() == null) { + if (fInitializingTabs || (getWorkingCopy() == null)) { return false; } try { @@ -1274,11 +1271,7 @@ private boolean hasMultipleDelegates() { * @return the error message for the tab */ public String getErrorMesssage() { - if (fInitializingTabs) { - return null; - } - - if (getWorkingCopy() == null) { + if (fInitializingTabs || (getWorkingCopy() == null)) { return null; } try { @@ -1455,12 +1448,14 @@ protected void handleTabSelected() { fCurrentTabIndex = fTabFolder.getSelectionIndex(); ILaunchConfigurationTab[] tabs = getTabs(); - if (previousTabIndex == fCurrentTabIndex || tabs == null || tabs.length == 0 + if (tabs == null || tabs.length == 0 || previousTabIndex > (tabs.length - 1)) { return; } - propagateTabDeactivation(previousTabIndex); + if (previousTabIndex != fCurrentTabIndex) { + propagateTabDeactivation(previousTabIndex); + } propagateTabActivation(); }