Is there an easy way to add a new hover control to an Eclipse plugin? More than just specifying what text should appear in the standard hover control, I want to create a new set of controls.
I’m writing an Eclipse plugin that will run on top of PyDev, and I want to add a hover control with a slider that lets you edit numeric values in Python code. You can see an example of what I’m trying to recreate in Bret Victor’s Inventing on Principle lecture.
I’ve found a good example by Dan Breslau that shows how to write a new hover control that implements ITextHover and ITextHoverExtension2. I also looked in the PyDev source to find PyTextHover that implements ITextHoverExtension. I think ITextHoverExtension is what I need to create a new set of controls for the hover.
Is there a way for me to chain my hover control in with the standard PyDev controls? Is the PyDev team willing to add another extension point like pydev_hover, but with the ability to create the controls in the hover window?
I think that the way to go would be exactly what you’re saying.
I.e.: override the text hover used by PyDev — created at: org.python.pydev.editor.PyEditConfiguration.getTextHover(ISourceViewer, String) adding another extension to override the hover (i.e.: pydev_hover_override) — it’d have to check for the pydev_hover_overrides available and pass through all of those and and asking it to handle the hover (and if none of those does handle it, then it should just go on with the default PyTextHover).
Cheers,
Fabio