Community
Participate
Working Groups
CodeMining provides the capability to draw content before a line. It should be cool if user could execute an action on click on mining. Here some examples of action mining with Java Editor: * click on "n references" mining executes the JDT search references (like Ctrl+Shift+G) * click on "n implementation" mining open the JDT Implementation dialog (like Ctrl+T)kind of events?) * click on "Run/Debug" icons (before a main method or @Test methods) execute the Java class. To support this feature, ICodeMining should support: * hover mining: when mining is hovered, the label mining (or icons) must be displayed as hovered (like an hyperlink for label) * gives the capability to add an action with a new API like ------------------------------------------ ICodeMining#addSelectionListener(CodeMiningSelectionListener listener) ICodeMining#removeSelectionListener(CodeMiningSelectionListener listener) ------------------------------------------ Question: if we have addSelectionListener, it means that we have several actions to execute, is it a good idea? Perhaps we should provide an hover which displays list of available actions to execute (like Hyperlink)?
+1. Note that these workflows can already be implemented by placing MouseListeners in the `draw` method. It's not extremely straightforward, but it works ;) (In reply to Angelo ZERR from comment #0) > * hover mining: when mining is hovered, the label mining (or icons) must be > displayed as hovered (like an hyperlink for label) I don't think we should give user the opportunity to tweak it. If they use an AbstractCodeMining, hover should just underline the label or icon for instance. Users shouldn't be requested to implement it manually. > * gives the capability to add an action with a new API like > ------------------------------------------ > ICodeMining#addSelectionListener(CodeMiningSelectionListener listener) > ICodeMining#removeSelectionListener(CodeMiningSelectionListener listener) > ------------------------------------------ > Question: if we have addSelectionListener, it means that we have several > actions to execute, is it a good idea? Perhaps we should provide an hover > which displays list of available actions to execute (like Hyperlink)? Let's start smaller and minimize APIs there. The 'codeMiningSelected' action could simply be an (optional) method to implement in the ICodeMining implementation. Let's avoid creating specific listener, and start by assuming the provider of the CodeMining has the full control over the action, before implementing some extensibility we may not need. For example, the `N implementations` codemining would implement a `codeMiningSelected()` method that would show the search result.
@Mickael, once you will accept https://bugs.eclipse.org/bugs/show_bug.cgi?id=529087 I will create a gerrit patch to support action. It will help more to discuss about this feature. Please note that, I'm using this action support for: * inside the InlinedAnnotationDemo (now you can click on the colorized square to open the ColorDialog). * to Run/Debug Junit test See demo at https://bugs.eclipse.org/bugs/show_bug.cgi?id=529316
New Gerrit change created: https://git.eclipse.org/r/115075
Gerrit change https://git.eclipse.org/r/115075 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=e8186dc22f970dae14d07ccb5341906955989f29
New Gerrit change created: https://git.eclipse.org/r/115809
@Mickael, please review my N&N. Thanks!
Gerrit change https://git.eclipse.org/r/115809 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=7af0e31a19e9566f7fb8819ed75278c6cf42265b
Thanks @Lars, @Mickael for your review!