-
Notifications
You must be signed in to change notification settings - Fork 193
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
Find/Replace overlay: move components into internal package #2013
Find/Replace overlay: move components into internal package #2013
Conversation
Extracted from #1990 |
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.
Wouldn't it make sense to also move the FindReplaceOverlay
to the org.eclipse.ui.internal.findandreplace.overlay
package? Then the other classes could remain package protected, as they are only supposed to be used by the overlay class (and not any other class in the bundle).
FindReplaceOverlay uses package-private methods of StatusTextEditor and for now, I don't want to touch StatusTextEditor. Also, since the Dialog is also in ui.texteditor, I believe it is best if (for now!) we keep the Overlay in ui.texteditor |
@Wittmaxi by the way a good way to decouple things is usually using the Eclipse Adapters (e.g. implements
without need to call any methods directly on the target. |
I see. Then, however, I am not sure about the value of the proposed refactoring. What's the pain point in keeping the classes where they currently are? In particular, placing the overlay class in a different package than its first-time usage popup and it's images provider class does not look sound to me. |
@HeikoKlare I am fine with moving these specific classes back. The reason I want to refactor these classes is that I am expecting many helper classes for the Overlay (For example in the PR adding a search-history) which are not really related to the texteditor-ui. |
Thanks for the explanation. Now I understand. Following the advice from @laeubi sounds good! The following should probably already do the trick: Control targetWidget = textEditor.getAdapter(ITextViewer.class).getTextWidget(); |
@HeikoKlare yes! This works :) |
Test Results 1 815 files ±0 1 815 suites ±0 1h 35m 28s ⏱️ - 1m 15s Results for commit 4276de4. ± Comparison against base commit 769d5d1. This pull request removes 16 and adds 16 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Access should of course be made via Control targetWidget = Adapters.adapt(textEditor, ITextViewer.class).getTextWidget(); |
@HeikoKlare what is the difference between your proposals and why use the second one instead of the first one? The first one already works perfectly! |
11f8e14
to
529474b
Compare
Maybe in this case it is even fine to call I guess the reason is that there may be more adapters than delivered by |
529474b
to
4674cdf
Compare
|
moves helper classes for the find/replace overlay into an internal package.
4674cdf
to
1253061
Compare
This moves the test classes for the find/replace functionality, in particular the ones for the find/replace overlay, to the packages according to those of the production classes.
moves helper classes for the find/replace overlay into an internal package.