HintManager API question

Hi,

is there a reason why the apparently quite useful class
com.intellij.codeInsight.hint.HintManager
and its friends are not part of the OpenAPI?

It's quite hard to determine the usage of it, such as the meaning of the parameters for
HintManager.showEditorHint(). Would it be possible to publish the method signatures of
those methods that take bit-flag combinations and non-obvious boolean parameters? Maybe
even with a little explanation if the parameter names aren't obvious?

TIA,
Sascha

8 comments
Comment actions Permalink

Hi,

as the matter of fact opening an API for the HintManager will require some
work on it's interface and inverting some dependencies, which we're not ready
to do right away. Most probably there will be an open API for this in >5.0+.

Until then, the signature is as follows:
public void showEditorHint(final LightweightHint hint,
final Editor editor,
Point p,
int flags,
int timeout,
boolean reviveOnEditorChange)


reviveOnEditorChange means hint should stay even if active editor have been
changed. It's should rarely be true.

possible flags are:
public static final int HIDE_BY_ESCAPE = 0x01;
public static final int HIDE_BY_ANY_KEY = 0x02;
public static final int HIDE_BY_LOOKUP_ITEM_CHANGE = 0x04;
public static final int HIDE_BY_TEXT_CHANGE = 0x08;
public static final int HIDE_BY_OTHER_HINT = 0x10;
public static final int HIDE_BY_SCROLLING = 0x20;
public static final int HIDE_IF_OUT_OF_EDITOR = 0x40;
public static final int UPDATE_BY_SCROLLING = 0x80;


-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

is there a reason why the apparently quite useful class
com.intellij.codeInsight.hint.HintManager
and its friends are not part of the OpenAPI?
It's quite hard to determine the usage of it, such as the meaning of
the parameters for HintManager.showEditorHint(). Would it be possible
to publish the method signatures of those methods that take bit-flag
combinations and non-obvious boolean parameters? Maybe even with a
little explanation if the parameter names aren't obvious?

TIA,
Sascha



0
Comment actions Permalink

Thanks for the information, Max. As long as the class doesn't get obfuscated at one
point there's no real need for it to be in the OpenAPI. And I think you probably got
better things to do :)

Sascha

PS: Exploring idea.jar is very exciting, much like a treasure hunt with all the hidden
goodies in there ;)

0
Comment actions Permalink

Interesting. What's an editor hint do?

--Dave Griffith

0
Comment actions Permalink

Dave Griffith wrote:

Interesting. What's an editor hint do?


That's the thing that can show popup information in the editor, like the ones
I have attached. Quite useful stuff :)

Sascha



Attachment(s):
hint2.PNG
hint.PNG
0
Comment actions Permalink

On Wed, 11 May 2005 22:55:10 +0200, Sascha Weinreuter wrote:

PS: Exploring idea.jar is very exciting, much like a treasure hunt with
all the hidden goodies in there ;)



Gah - on one side people are complaining the OpenAPI and funkyness are
hidden, and undocumented, and on the other side - we're enjoying an easy
egg hunt, for donuts ( oh wait, this post is about a new EAP is it? ]]> ).

We're our own worst enemy here guys :p

0
Comment actions Permalink

Why does HintManager.getInstance() return ]]> (called inside AnAction.actionPerformed()) ?

0
Comment actions Permalink

Yann Cebron wrote:

Why does HintManager.getInstance() return <null> (called inside AnAction.actionPerformed()) ?


Don't add idea.jar as a library to your plugin module. Add it to your IDEA-JDK.

Sascha

0
Comment actions Permalink

Doohhh - ofcourse. Thanks for the hint, works like a charm now ;)

0

Please sign in to leave a comment.