Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Applet context in Visual Editor
Applet context in Visual Editor [message #99201] Fri, 22 July 2005 12:13 Go to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
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
Re: Applet context in Visual Editor [message #99263 is a reply to message #99201] Fri, 22 July 2005 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Use Beans.isDesignTime(). This is true when running in a visual editor
and false when in production.

--
Thanks,
Rich Kulp
Re: Applet context in Visual Editor [message #99711 is a reply to message #99263] Sun, 24 July 2005 06:09 Go to previous messageGo to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
Rich Kulp wrote:
> Use Beans.isDesignTime(). This is true when running in a visual editor
> and false when in production.
>
Oh. It's all so easy when you know what you're doing B-)=

Thanks...
Re: Applet context in Visual Editor [message #100342 is a reply to message #99711] Tue, 26 July 2005 23:19 Go to previous message
Joel Kamentz is currently offline Joel KamentzFriend
Messages: 30
Registered: July 2009
Member
Btw, it seems rather odd to be doing this in an applet. Are you sure that
an applet is what you want (rather than a webapp or RCP app or ...)?

Why?
* The applet will need to be signed in order to use Runtime.exec
* The Runtime.exec takes place on the client machine -- no guarantee where
Perl is on the client machine or if it even is installed at all.

Another point. When launching something with Runtime.exec and redirected
std in/out, you'll need multiple threads to handle reading the in, out and
err streams. These streams / pipes have a limited buffer space. If the
spawned process generates lots of output and you never read it (even though
you provided its standard out), the that process will hang, possibly causing
your original process to hang because it's trying to send something to the
child process' stdin.

Joel

"Andrew Merton" <nobody@nowhere.com> wrote in message
news:dbvba2$gj6$1@news.eclipse.org...
> Rich Kulp wrote:
>> Use Beans.isDesignTime(). This is true when running in a visual editor
>> and false when in production.
>>
> Oh. It's all so easy when you know what you're doing B-)=
>
> Thanks...
Re: Applet context in Visual Editor [message #609182 is a reply to message #99201] Fri, 22 July 2005 14:35 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Use Beans.isDesignTime(). This is true when running in a visual editor
and false when in production.

--
Thanks,
Rich Kulp
Re: Applet context in Visual Editor [message #609211 is a reply to message #99263] Sun, 24 July 2005 06:09 Go to previous message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
Rich Kulp wrote:
> Use Beans.isDesignTime(). This is true when running in a visual editor
> and false when in production.
>
Oh. It's all so easy when you know what you're doing B-)=

Thanks...
Re: Applet context in Visual Editor [message #610017 is a reply to message #99711] Tue, 26 July 2005 23:19 Go to previous message
Joel Kamentz is currently offline Joel KamentzFriend
Messages: 30
Registered: July 2009
Member
Btw, it seems rather odd to be doing this in an applet. Are you sure that
an applet is what you want (rather than a webapp or RCP app or ...)?

Why?
* The applet will need to be signed in order to use Runtime.exec
* The Runtime.exec takes place on the client machine -- no guarantee where
Perl is on the client machine or if it even is installed at all.

Another point. When launching something with Runtime.exec and redirected
std in/out, you'll need multiple threads to handle reading the in, out and
err streams. These streams / pipes have a limited buffer space. If the
spawned process generates lots of output and you never read it (even though
you provided its standard out), the that process will hang, possibly causing
your original process to hang because it's trying to send something to the
child process' stdin.

Joel

"Andrew Merton" <nobody@nowhere.com> wrote in message
news:dbvba2$gj6$1@news.eclipse.org...
> Rich Kulp wrote:
>> Use Beans.isDesignTime(). This is true when running in a visual editor
>> and false when in production.
>>
> Oh. It's all so easy when you know what you're doing B-)=
>
> Thanks...
Previous Topic:Unable to get VE to work
Next Topic:XSWT support?
Goto Forum:
  


Current Time: Tue Apr 16 09:14:42 GMT 2024

Powered by FUDForum. Page generated in 0.47002 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top