Productivity Hints?

Hi all,

I was wondering: is it possible to access the ProductivityHints in any was possible? For example, I want to programatically add some hints to it: is it possible? (and a hint in the right direction would be nice!). I've checked the IdeaDoc, and the only reference I saw were the productivityfeaturesprovider and registry, but I have the feeling they are something else...

Suggestions?

14 comments
Comment actions Permalink

no, you're on the right track ;) you can use an application component extending ProductivityFeaturesProvider to provide your own tips

I've attached a sample, you'll need to supply the HTML files additionally



Attachment(s):
StrutsProductivityFeaturesProvider.java
0
Comment actions Permalink

Nice, thanks! Another small question: is it enough to define a ProductivityFeaturesProvider, or do I also need to register them somewhere?

0
Comment actions Permalink

IIRC you only need to register your class as application component

0
Comment actions Permalink

Okay, did that, and it seems to be working. But where do I put the HTML files? I actually don't want to supply them, but download them from the web. At the moment, It seems like I can only provide TipFileNames, which are loaded from 'somewhere'. How does this work?

Is there a place where I can find some documentation or something? I'm really looking forward into building this plugin, but finding some documentation (or even Javadoc) is quite hard!

0
Comment actions Permalink

You have to provide the HTML files packaged with your plugin (TipFileName = relative path to source-root).

w/r to missing Javadoc: JB is happy to receive patches with quality documentation and will for sure apply them ;)

0
Comment actions Permalink

Hi Yann,

I think I did as you said: I've created a file (hints.hello.html), put it in ]]>/src/, referenced it using "FeatureDescriptor featureDescriptor = new FeatureDescriptor("id", GROUP_DESCRIPTOR_ID, "hints.hello.html", "Hello", 0, 1, null, 1, this);", but when I look at the Productivity Hint, all I see is: "Unable to read Tip Of The Day. Make sure IntelliJ IDEA is installed properly.".

To fix this, I tried multiple alternatives, like renaming the file to hello.html, dropping it in different locations, but untill now, it doesn't load! I've attached the project, if you (or anyone else) has an idea, please let me know!

Thanks for the help so far!



Attachment(s):
productivityhints.zip
0
Comment actions Permalink

sorry, these HTML files must be located in SRC_ROOT/tips

0
Comment actions Permalink

Great, that works! Thanks!! But how did you know that? And do you also know why it's not possible (unless you have a suggestion...) to retreive the Productivity Hints from an online source?

0
Comment actions Permalink

Um, I don't remember. Probably on this forum here?

I suppose the current behaviour of using local HTML files is hardcoded in IDEA, so you might want to create a RFE in JIRA for that. What's the specific usecase?

0
Comment actions Permalink

My specific usecase was that I wanted to created an online repository with Productivity Guides, powered by the IntelliJ community. Currently, the hints/tips are quite static, but if I can retrieve the productivity hints online, the productivity hints can be much more dynamic. That's why filenames don't cut it for me.

Btw, if you have an online possibility, you can do much more with it. You could even present RSS feeds or news items without leaving the IDE, so you won't get distracted. I'll file a RFC for this!

0
Comment actions Permalink

Lately I've added some productivity tips and put some html files with description into tips directory in my plugin - it's working for IDEA 12.1.7 but in 13.1.4 Productivity Guide only says: Unable to read Tip Of The Day ( <some_feature_description_file>.html). Make sure      IntelliJ IDEA is installed properly.
Something was changed in 13. version of IDEA?



Attachment(s):
tips_problem_13.png
tips_problem_12.png
0
Comment actions Permalink

Did you verify tip files (HTML) are correctly packaged in plugin distribution?

0
Comment actions Permalink

Yes, it is ok. I found that I need register addidtional tipAndTrick extension for every feature I registered in my productivityFeaturesProvider (this fix the problem), but I do not understand for what I need to repeat myself? Its seems redundant for me. Now in IDEA 13. I need to repeat some informations about feature in two places: productivityFeaturesProvider and tipAndTrick extension for every feature... It is not good, IMHO. I think that beans created by tipAndTrick extensions should be extracted from registered information in productivityFeaturesProvider. Can You explain why this was changed since IDEA 12?

Message was edited by: Marcin Rembała

0
Comment actions Permalink

I tried to run the zipped example, but I got this error:

Error occurred during initialization of VM
Could not find agent library: libyjpagent.jnilib (searched /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries:/System/Library/Java/Extensions:/Library/Java/Extensions:.)


Where can I find libyjpagent.jnilib ?

Thanks!
0

Please sign in to leave a comment.