Skip to main content

Need help : Issues while adding a new sub menu in Tool menu

5 replies [Last post]
anuj_mehta
Offline
Joined: 2008-05-22
Points: 0

Hi

I am trying to add a new sub menu in Tool menu but the menu is not coming in Desktop. I have done following

1) Created a class say MyTool which extends the Tool class and implemented the necessary methods.
2) Created a class say MyToolManager which extends ToolManager and implemented the required methods

Now while debugging I observed that my ToolManager class is not getting loaded

In Desktop.java -->initToolManager()
Set s = ml.loadManagers(TOOLMGRLIST);

This set contains the existing ToolManager classes but not mine.

Please guide me where I am going wrong?

Regards,
Anuj
http://anuj-mehta.blogspot.com

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13
Points: 0

Ah, see Jon's suggestion about the classpath, I forgot about that. The fact that changing the file in javatest.jar is a great sign that you are on the right path.

Brian

anuj_mehta
Offline
Joined: 2008-05-22
Points: 0

@bkurotsu

Thanks for help. It works now. But I do agree with 'vsizikov' that it's better we don't modify the javatest.jar, I was thinking of contributing to javatest probably I can try to modify this as a good starting point :)

Regards,
Anuj
http://anuj-mehta.blogspot.com

Jonathan Gibbons

jtharness@mobileandembedded.org wrote:
> @bkurotsu
>
> Thanks for help. It works now. But I do agree with 'vsizikov' that it's better we don't modify the javatest.jar, I was thinking of contributing to javatest probably I can try to modify this as a good starting point :)
>
> Regards,
> Anuj
> http://anuj-mehta.blogspot.com
> [Message sent by forum member 'anuj_mehta' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=372131
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jtharness.dev.java.net
> For additional commands, e-mail: interest-help@jtharness.dev.java.net
>
>
Brian,

JavaTest should look for all copies of the file JavaTest.toolMgrs.lst on
the classpath. (See the call loader.getResources(resourceName) round
about .line 67 of ManagerLoader.java. )

So, if someone extends JavaTest (or JT Harness) by adding new jars onto
the classpath, if those new jars contain new Tool classes for JavaTest
to use, the jar should declare them in its own copy of
JavaTest.toolMgrs.lst.

At least, that's how it was supposed to work; I don't know if anyone has
used this feature before. :-)

-- Jon

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jtharness.dev.java.net
For additional commands, e-mail: interest-help@jtharness.dev.java.net

bkurotsu
Offline
Joined: 2004-12-13
Points: 0

There is a file called JavaTest.toolMgrs.lst in the javatest.jar archive. It needs to contain the class name of your new tool, which should get JT to load your new tool.

As you can see, the system is pluggable to allow this, but perhaps not as refined as it can be. Specifically - the most obvious way to do it now is to alter that file which lives within javatest.jar. We haven't made any improvements for pluggability because nobody has ever added their own tool outside of the core harness code.

Message was edited by: bkurotsu

vsizikov
Offline
Joined: 2004-11-16
Points: 0

Hi Brian,

Actually, this kind of flexibility would be useful for us (ME Framework) as well.

Please, take a look at the following issue: https://jtharness.dev.java.net/issues/show_bug.cgi?id=71

It would be great if this could be implemented in the next JTHarness release.

Modifying the original javatest.jar is a big no-no to us, since we'd like to use the official binary. But it would be indeed great if we could add/remove menus/tools without javatest.jar modifications.