-
Notifications
You must be signed in to change notification settings - Fork 83
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
Packages/bundles that are already imported/added are shown #1195
base: master
Are you sure you want to change the base?
Packages/bundles that are already imported/added are shown #1195
Conversation
@lathapatil - did change set from #1194 carry over into this PR? |
No, I am trying to figure out what went wrong. Looks like #1194 has not reached here along with its branch ! |
Test Results 279 files - 1 279 suites - 1 45m 15s ⏱️ - 6m 33s For more details on these failures, see this check. Results for commit 15a6239. ± Comparison against base commit b29e97a. ♻️ This comment has been updated with latest results. |
it is probably because you branched out for this PR from the previous branch, so the tip of the branch got carried over. nothing to worry: I will help you fix that. if you are using command line then do this:
|
6d51a60
to
f0da0ed
Compare
Yes. Thanks for the support . |
@laeubi Could you please test the PR if it meets the expectations and possibly review the code ? |
@lathapatil do I need to consider something special? I fetched this PR then started an embedded workbench and tried the following: but package I also think it would be good to have a checkbox (enabled by default) "Show already imported packages", at best the user choice is persisted to survive a restart. |
After checking out the pull request (PR) while in PDE workspace , switch to the PR branch and launch the Eclipse application. Then, create a plugin project and inspect the manifest file for imported packages, required bundles, and exported packages. This is what I have attempted, and the changes are visible. What do you mean by embedded workbench ? |
This is already part of the PR. But I observed there is some delay in loading all packages |
Please find attached video for working of the feature from the branch https://github.com/lathapatil/eclipse.pde/tree/Issues/146_Show_imported_exported_required_bundles 2024-04-09_15h43_11.mp4 |
@laeubi could you please try testing and reviewing this ? |
@lathapatil - sure, will do. also, could you pls rebase your changes? as it was quite some time, now there is a conflict that has emerged. |
aeb906f
to
7b670f6
Compare
Now it is rebased with conflicts resolved. Could you please verify the behavior |
@lathapatil - thanks, I tested this and found two minor issues. not sure if you want to fix it in this PR or another one:
|
Fixes eclipse-pde#146 Files not present in branch but changes are visible in github commit Missed code/files while Conflict resolution
8717f18
to
15a6239
Compare
in my opinion enabling ADD button is valid because user have selected one which is not added yet in the multiple selection and only that will be added as a result. It is mentioned here as well
I found one bug in this and fixed please take latest commit . |
@lathapatil - I tested the new changes, and it works fine, as you have showed in the video. thanks! |
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.
Thanks for working on this.
I havn't done a technical/functional review but have a few style remarks below.
@@ -153,8 +159,8 @@ private static IPluginModelBase[] getElements(boolean includeFragments) { | |||
return PluginRegistry.getActiveModels(includeFragments); | |||
} | |||
|
|||
public static HashSet<String> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { | |||
HashSet<String> existingImports = new HashSet<>(); | |||
public static HashMap<String, Boolean> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { |
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.
Please use only collection interfaces (as abstract as possible) if possible here and in all other changed code. Using a specific implementation is usually unnecessarily restrictive.
public static HashMap<String, Boolean> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { | |
public static Map<String, Boolean> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { |
|
||
HashMap<String, Boolean> existingImports = PluginSelectionDialog.getExistingImports(currentModel, false); |
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.
Instead of setting IPluginModelBase currentModel
via a setter and saving it, could you just use the following?
if (pluginBase.getModel() instanceof IPluginModelBase pluginModel) {
...
Because the less state we have the better. I also don't know if currentModel
can be null at this point in any usage scenario and if the called PluginSelectionDialog.getExistingImports
method would handle that well.
if (selection instanceof IPluginModelBase | ||
&& !(existingImports.keySet().contains(((IPluginModelBase) selection).getPluginBase().getId()))) { |
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.
Please use pattern matching for instanceof in all changed code and if applicable.
if (selection instanceof IPluginModelBase | |
&& !(existingImports.keySet().contains(((IPluginModelBase) selection).getPluginBase().getId()))) { | |
if (selection instanceof IPluginModelBase pluginModel && !(existingImports.keySet().contains(pluginModel).getPluginBase().getId()))) { |
Please also reformat the line, not sure if it fits in one line now.
public static HashSet<String> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { | ||
HashSet<String> existingImports = new HashSet<>(); | ||
public static HashMap<String, Boolean> getExistingImports(IPluginModelBase model, boolean includeImportPkg) { | ||
HashMap<String, Boolean> existingImports = new HashMap<>(); |
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.
Maybe I oversaw something, but I can only see the key-set of the map being used and values seem not to be considered at all. If that's correct, can this Map
stay a Set
?
Packages/bundles that are already imported/added are shown followed by [already imported/added]
Fixes #146