-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select the current tab after displaying them #766
Select the current tab after displaying them #766
Conversation
FYI this PR is a must in order to be able to merge eclipse-pde/eclipse.pde#674 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the necessity and goal of the change, but to me it does not look like a proper solution for the issue. Here are my concerns:
handleTabSelected()
explicitly avoids a reactivation when the tab index did not change. Is it correct to remove that precondition? I see that if you want to (mis)use the method to reactivate a tab, this condition must be removed, but is that what the method is supposed to do (considering its other usages)? Otherwise it might make more sense to move that reactivation functionality into a separate method that is called in the scenario to be addressed without the precondition of thehandleTabSelected()
method. That might make sense anyway ashandleTabSelected
suggests that it should be called if a tab was selected, but this is not even the case here. It is rather aboutreloadTab
or the like.- The
displayInstanceTabs()
methods does already process all the tabs in its call ofshowInstanceTabs()
. It callssetActiveTab()
for all tabs once and then calls it again for the one that that is to be active afterwards. However, thesesetActiveTab
calls finally seem to do nothing else than callinghandleTabSelected
, which does nothing asfInitializingTabs
is set totrue
, so the method immediately returns without doing anything. So maybe there is something broken in the overall functionality, as it looks to me as if the last lines of code inshowInstanceTabs
are supposed to do exactly what this PR is trying to fix. Please check what that code does. And if it is really not related to what this PR is supposed to achieve, it may at least point to a better solution of the problem.
4889d80
to
477caa2
Compare
@HeikoKlare I changed it so The 3 use cases
This PR should be ready to be merged now. |
The failed check is unrelated to the changes, it seems to be a problem with Tycho and the tests in Mac: Error: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.4-SNAPSHOT:test (default-test) on
project org.eclipse.core.tests.resources: Execution default-test of goal
org.eclipse.tycho:tycho-surefire-plugin:4.0.4-SNAPSHOT:test failed: Exception creating test eclipse runtime:
zip file is empty -> [Help 1] |
Please see my previous comment. From my understanding, there is already code that is supposed to do what this change is trying to do. Either correct me in case I am wrong or otherwise please fix or replace that code. |
Make sure that the selected tab is activated (i.e. that its "activate" method is called) when switching between existing run configurations in the "Run configurations" dialog. Contributes to eclipse-pde/eclipse.pde#674
477caa2
to
1ea5dce
Compare
I re-read your previous comment and made some changes. I pushed the activation of the tabs all the way back to the end of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the latest solution 👍 In my opinion, it is very comprehensible now. I have only minor comments to the fix itself. And could we add a regression test for it?
Please also fix the Javadoc of the refreshTabs0
method when touching it anway.
...ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
Show resolved
Hide resolved
...ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
Show resolved
Hide resolved
Thank you for your reviews, @HeikoKlare ! I merged this one so eclipse-pde/eclipse.pde#674 can be also merged.
Let's put a pin on that. The new functionality has been tested manually and it's looking fine.
I didn't touch that one. |
I want to mention that the addition of tests ist permitted all the time, so no reason to postpone that from a RelEng/freeze-time point of view. :) |
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Also add a new test bundle that contains the proper regression test. Bundle: org.eclipse.debug.ui.tests Class: LaunchConfigurationTabGroupViewerTest This class also contains a regression test for eclipse-platform#766 Fixes: eclipse-platform#859
Call
handleTabSelected
right after displaying all tabs in theLaunchConfigurationTabGroupViewer::displayInstanceTabs
so that the "activated" method of the tab is called.This is necessary in order to give every tab the chance to compute/show its content when it is first selected by changing between Run configurations in the Run Configurations Dialog.
Contributes to eclipse-pde/eclipse.pde#674
How to test
activated
method of that tab should have been called (the method extends/overridesorg.eclipse.debug.ui.ILaunchConfigurationTab.activated(ILaunchConfigurationWorkingCopy)
)e.g. testing with Product Run Configurations (PDE)
4.1. Add a breakpoint in
org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab.activated(ILaunchConfigurationWorkingCopy)