Tooltips for code fragments

When the mouse cursor hovers over a code fragment that
has the red squiggly line under it, a tooltip with an
error message shows up.

I'm writing a plugin that also needs to show tooltips
for certain code fragments. Does the OpenAPI expose
this (for lack of a better word) TooltipManager?

Or do I have to start from Editor.getContentComponent()
and do it all myself?

Any help is appreciated.

Thanks,
Thomas






0

It's not exposed into the Open API yet. We are considering that though.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Thomas Vollmer" <thomas.vollmer@itt.com> wrote in message
news:artnns$j52$1@is.intellij.net...

When the mouse cursor hovers over a code fragment that
has the red squiggly line under it, a tooltip with an
error message shows up.

>

I'm writing a plugin that also needs to show tooltips
for certain code fragments. Does the OpenAPI expose
this (for lack of a better word) TooltipManager?

>

Or do I have to start from Editor.getContentComponent()
and do it all myself?

>

Any help is appreciated.

>

Thanks,
Thomas

>
>
>
>
>
>


0

Thanks for your reply. It would really be handy to have this
functionality be exposed in the Open API.

Until then, what are my options to do something like this?

Thanks,
Thomas





"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:arvjb0$b8o$1@is.intellij.net...

It's not exposed into the Open API yet. We are considering that though.

>

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

>

"Thomas Vollmer" <thomas.vollmer@itt.com> wrote in message
news:artnns$j52$1@is.intellij.net...

When the mouse cursor hovers over a code fragment that
has the red squiggly line under it, a tooltip with an
error message shows up.

>

I'm writing a plugin that also needs to show tooltips
for certain code fragments. Does the OpenAPI expose
this (for lack of a better word) TooltipManager?

>

Or do I have to start from Editor.getContentComponent()
and do it all myself?

>

Any help is appreciated.

>

Thanks,
Thomas

>
>
>
>
>
>

>
>


0

Actually we use LayeredPane's for popup windows. We used to use Window's but
since 1.4 managing focus became a real pain (if possible at all) and we
switched.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Thomas Vollmer" <thomas.vollmer@itt.com> wrote in message
news:as097u$psp$1@is.intellij.net...

Thanks for your reply. It would really be handy to have this
functionality be exposed in the Open API.

>

Until then, what are my options to do something like this?

>

Thanks,
Thomas

>
>
>
>
>

"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:arvjb0$b8o$1@is.intellij.net...

It's not exposed into the Open API yet. We are considering that though.

>

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

>

"Thomas Vollmer" <thomas.vollmer@itt.com> wrote in message
news:artnns$j52$1@is.intellij.net...

When the mouse cursor hovers over a code fragment that
has the red squiggly line under it, a tooltip with an
error message shows up.

>

I'm writing a plugin that also needs to show tooltips
for certain code fragments. Does the OpenAPI expose
this (for lack of a better word) TooltipManager?

>

Or do I have to start from Editor.getContentComponent()
and do it all myself?

>

Any help is appreciated.

>

Thanks,
Thomas

>
>
>
>
>
>

>
>

>
>


0

Thanks for the info. I've started to play around with the LayeredPane
I get from editor.getContentComponent().getRootPane().getLayeredPane().

It seems to cover the entire IDEA window though, not just the editor,
which might just be how Swing works (I'm not a Swing expert). Anyway,
it seems like I have to convert the XY coordinates returned from
editor.logicalPositionToXY(editor.getCaretModel().getLogicalPosition())
into coordinates I can use in the LayeredPane mentioned above.

Any hints would be helpful.

Thanks,
Thomas



"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:as0ad2$sdd$1@is.intellij.net...

Actually we use LayeredPane's for popup windows. We used to use Window's

but

since 1.4 managing focus became a real pain (if possible at all) and we
switched.

>

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"



0

It seems to cover the entire IDEA window though, not just the editor,
which might just be how Swing works (I'm not a Swing expert). Anyway,
it seems like I have to convert the XY coordinates returned from
editor.logicalPositionToXY(editor.getCaretModel().getLogicalPosition())
into coordinates I can use in the LayeredPane mentioned above.

Any hints would be helpful.


Try using:
javax.swing.SwingUtilities.convertPoint(
Component source,
Point aPoint,
Component destination)

I don't know what performance will be like, but it should do the
conversion for you.


~Mike

0

Thanks Mike. It works great :)
-Thomas

"Mike Abney" <michaelno.abneyspam@retek-nospam-.com> wrote in message
news:Xns92D36EFB34CC3michaelabney1990@213.182.181.98...

It seems to cover the entire IDEA window though, not just the editor,
which might just be how Swing works (I'm not a Swing expert). Anyway,
it seems like I have to convert the XY coordinates returned from
editor.logicalPositionToXY(editor.getCaretModel().getLogicalPosition())
into coordinates I can use in the LayeredPane mentioned above.

>

Any hints would be helpful.

>

Try using:
javax.swing.SwingUtilities.convertPoint(
Component source,
Point aPoint,
Component destination)

>

I don't know what performance will be like, but it should do the
conversion for you.

>
>

~Mike



0

请先登录再写评论。