Board index » jbuilder » How to add an menu item to the right click context menu?

How to add an menu item to the right click context menu?


2005-09-21 08:00:26 AM
jbuilder18
Hi,
I am trying OPenTools for the first time.
I went through all the samples and scanned the APIs but I cannot find a
straight forward
way to do what I need.
Here is what I need.
1) I have a .java file which has some static ints defined like
public static final int MYVAL = 101;
2) Now there is a Resource .properties file which has the same number
defined as a text string
101=Blah Blah Blah
3) When I highlight the variable MYVAL in the .java file I want to use the
context menu and select this
special menu item that I will add. When I select that menu item, I wish to
be able to look up the value
of int 101 in the .properties file and display it either as a tooltip or in
the messages window below.
Can you please help me with this. I really am in a tight spot due to time
constraints. I am new to JBuilder
and was using NetBeans IDE till now.
Please help.
Thanks,
Sunit
 
 

Re:How to add an menu item to the right click context menu?

Sunit Katkar wrote:
Quote
3) When I highlight the variable MYVAL in the .java file I want to use the
context menu and select this
special menu item that I will add. When I select that menu item, I wish to
be able to look up the value
of int 101 in the .properties file and display it either as a tooltip or in
the messages window below.
I believe you are looking to implement a ContextActionProvider
Do a Search>Find in Path, with the path set to the "samples"
folder of the JBuilder installation. Make sure the "include
subdirectories" option (at lower left) is checked, and search
for "contextactionpro".
You should get three hits, and those should be enough to
get you started. After that, go to Code Central
(cc.borland.com/community), JBuilder Open Tools,
search for OTs by Keith Wood, most of which include
the source code. They are great learning tools.
--
Paul Furbacher (TeamB)
Save time, search the archives:
info.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
 

Re:How to add an menu item to the right click context menu?

Thank you very much for your help.
I was able to start off in the right direction. Its unfortunate that such a
powerful API has
very little documentation and sample code.
Thanks again,
Sunit Katkar
"Paul Furbacher [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
Sunit Katkar wrote:

>3) When I highlight the variable MYVAL in the .java file I want to use
the
>context menu and select this
>special menu item that I will add. When I select that menu item, I wish
to
>be able to look up the value
>of int 101 in the .properties file and display it either as a tooltip or
in
>the messages window below.

I believe you are looking to implement a ContextActionProvider

Do a Search>Find in Path, with the path set to the "samples"
folder of the JBuilder installation. Make sure the "include
subdirectories" option (at lower left) is checked, and search
for "contextactionpro".

You should get three hits, and those should be enough to
get you started. After that, go to Code Central
(cc.borland.com/community), JBuilder Open Tools,
search for OTs by Keith Wood, most of which include
the source code. They are great learning tools.


--


Paul Furbacher (TeamB)

Save time, search the archives:
info.borland.com/newsgroups/ngsearch.html

Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html

Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
 

{smallsort}