-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Repositories View: MavenRepo: Add more copy to clipboard action menu entries on right click #5859
Repositories View: MavenRepo: Add more copy to clipboard action menu entries on right click #5859
Conversation
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
* github ci build complains, but I don't have this locally. maybe https://bugs.openjdk.org/browse/JDK-8260566 ? RepoActions.java:195: error: expression type MavenBndRepository is a subtype of pattern type Actionable if (repo instanceof Actionable arepo) { Signed-off-by: Christoph Rueger <[email protected]>
Great! love this work. I agree it would be nice to have submenus but this would require a bigger change in the support. This code is not allowed to touch Eclipse code in any way because it is part of bndlib. We could make the menu names hierarchical but then we probably want to move the menu builder out of the RepositoriesView and put in some util. I'd say nice to have but there are more interesting things to do right now.
|
A possible alternative to submenus: a single menu item for |
Do you mean, move the code for adding the "Copy to clipboard" menu entries e.g. here in And remove it from That way we would also have the ability to use Eclipse Code and do more fancy stuff, right? |
Signed-off-by: Christoph Rueger <[email protected]>
* it's just less clutter and both entries served the same purpose which is to have this info for debugging purposes at hand to paste it somewhere. Signed-off-by: Christoph Rueger <[email protected]> Just one linebreak Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Yes, you can change the Repositories View to your delight. The only thing that is paramount is that the bndlib code never touches Eclipse code ... Adjacent, the Repositories view must never know anything about the instance classes of the RepositoryPlugin interfaces. I.e. the Repository View is not allowed to cast the RepositoryPlugin to a BndRepositoryPlugin. The interface must fully go through the I'd be ok to do string matching on the label. We already to checkmarks etc. Making the labels hierarchical would be anice extension. However, if we go that route it would be nice to extract this actions -> menu handling in a separate class so we could potentially use it in other places. The |
Ok
Ok I will give this some thought. Label Example 1:
or Label Example 2: (double colon as delimiter)
Maybe double colon (::) is less likely to be used in the label text than slash? Thoughts? |
remove some method parameters I introduced earlier, which now turned out not to be used anymore. If it is needed in the future, it can be added again. just don't want to have unused stuff Signed-off-by: Christoph Rueger <[email protected]>
2c32b93
to
b091bd1
Compare
e.g. Copy to clipboard :: Copy GAV to clipboard Copy to clipboard :: Copy Compile Dependecies to clipboard will both be added to a submenu "Copy to clipboard" Signed-off-by: Christoph Rueger <[email protected]>
HierarchicalLabel<T> can now be used with any type... not just Actions. That way HierarchicalLabel is independent of Eclipse code and could be used in other contexts too. Maybe move more to core. Signed-off-by: Christoph Rueger <[email protected]>
Not sure if this is good to do this, but I thought at least it gives the implementors and the callers and idea that this String could contain a hierarchy delimiter which can be used for Submenues. If this is not good, we can revert it. Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
@pkriens I think this is ready for review and feedback. This
would roughly contribute to this menu and submenu: I also added the
Note: I added a note about the hierarchy delimiter to the Javadoc of |
Signed-off-by: Christoph Rueger <[email protected]>
LabelParser takes care of the RegEx parsing Signed-off-by: Christoph Rueger <[email protected]>
Are we ready to go? |
If you have no objections, yes. |
Ah wait... found something. Would fix that first. I give update @pkriens |
@chrisrueger sorry, saw your second message too late. |
I guess you have to make a new PR :-( |
Yeah sorry, was a bit of last minute. |
This PR adds more Copy to Clipboard actions to a revision of a leaf entry of a Repository item:
For example for an entry of
com.fasterxml.jackson.core.jackson-databind
:Add GAV to Clipboard
com.fasterxml.jackson.core:jackson-databind:2.13.4
is added to clipboardAdd tooltip to Clipboard
The content of this tooltip when you hover over a leaf-entry is added:
is added to the clipboard.
I found this helpful because the tooltip currently cannot be copy pasted and the tooltip contains useful information.
Add Compile Dependencies to Clipboard
is added to the clipboard.
It is basically similar to Add Compile Dependencies
I wanted to add "Runtime Dependencies" too, but always got an empty result. Didn't have time to investigate.
If you find it useful too, it's easy to add too.
Feedback
Consider this PR just a suggestion. My main goal was to have Add GAV to Clipboard because this is handy when researching a dependency on google. The idea for the other two entries just came by playing around with it.
We can remove them if they are too much. Ideally I would like to have a sub-menu "Copy to Clipboard" with those entries, but didn't know how to do that.
I can also add testcases, when we know what to keep and what not.