Applet context in Visual Editor [message #609178] |
Fri, 22 July 2005 12:13 |
Jean-Christophe Deprez Messages: 133 Registered: July 2009 |
Senior Member |
|
|
I've just spent a frustrating time (compounded by my lack of experience
with Java in general and applets specifically, of course) trying to work
out how to determine when my applet is running within Eclipse.
This was required because it starts a perl app (using Runtime.exec) and
then drives the app using the stdin/out, and sometimes misbehaves e.g.
Eclipse locks up until I kill the Perl directly, when I exit Eclipse.
I finally worked out that when running within the VE, the appletContext
starts with "org.eclipse.ve.internal.jfc.vm.DummyAppletContext", so if I
find this then I don't run the perl. (Of course, I also have to catch
the NullPointerException that arises when it's not running as an applet
at all e.g. when I start it using main()).
Is this the best way to go about this? (Is this string ever likely to
change? Is it a documented feature?)
If so, I'd suggest that putting this info in the Help for the VE could
be a good idea...
If it's not the best way to identify that you're running in the VE, what is?
Cheers
Andrew Merton
|
|
|
Powered by
FUDForum. Page generated in 0.02965 seconds