Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to refresh programmatically after exec()?
how to refresh programmatically after exec()? [message #160639] Sat, 22 November 2003 23:24 Go to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

I have an action that invokes an external tool on a set of files in a
selection; this tool potentially modifies the files. I use exec() to
invoke this external tool. Once this tool finishes I want to
automatically refresh the workspace, just like the External Tool
wizard allows one to do. I cannot simply call localRefresh() after
the exec() call because exec returns immediately, so my refresh call
would occur before the external tool finishes.

Where do I make this call? Do I need a listener to do it? If so,
how?

Thanks very much.

PS: I don't use the External Tool wizard for this because I need to
pass multiple resources (files) to the external tool. Too, I want to
have my own button and menu pull-down for it, but in any case I didn't
see a way with the wizard to pass more than one resource. Did I miss
something?
Re: how to refresh programmatically after exec()? [message #160749 is a reply to message #160639] Sun, 23 November 2003 20:10 Go to previous messageGo to next message
Genady Beryozkin is currently offline Genady BeryozkinFriend
Messages: 410
Registered: July 2009
Senior Member
Are you writing a plugin/code that has access to Eclipse API ?
If so, use IResource#refresh methods on projects/the workspace root.

Genady

Pat Rogers wrote:
> I have an action that invokes an external tool on a set of files in a
> selection; this tool potentially modifies the files. I use exec() to
> invoke this external tool. Once this tool finishes I want to
> automatically refresh the workspace, just like the External Tool
> wizard allows one to do. I cannot simply call localRefresh() after
> the exec() call because exec returns immediately, so my refresh call
> would occur before the external tool finishes.
>
> Where do I make this call? Do I need a listener to do it? If so,
> how?
>
> Thanks very much.
>
> PS: I don't use the External Tool wizard for this because I need to
> pass multiple resources (files) to the external tool. Too, I want to
> have my own button and menu pull-down for it, but in any case I didn't
> see a way with the wizard to pass more than one resource. Did I miss
> something?
>
>
Re: how to refresh programmatically after exec()? [message #160779 is a reply to message #160749] Sun, 23 November 2003 21:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Genady wrote:
> Are you writing a plugin/code that has access to Eclipse API ?
> If so, use IResource#refresh methods on projects/the workspace root.

Yes, but where, and when?
Re: how to refresh programmatically after exec()? [message #160821 is a reply to message #160639] Mon, 24 November 2003 07:12 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
Have a look at the
org.eclipse.ui.externaltools.internal.program.launchConfigur ations.ProgramLa
unchDelegate.launch and the
org.eclipse.ui.externaltools.internal.program.launchConfigur ations.Backgroun
dResourceRefresher.
You have two choices:
You can busy wait for your process associated with your external tool to
terminate
OR
do your refreshing asychronously like the BackgroundResourceRefresher.
Essentially you need to register as a debug event listener to trigger to
refresh the resources when the process associated with your external tool
terminates.

HTH
Darins

"Pat Rogers" <progers@classwide.com> wrote in message
news:bpor4b$l39$1@eclipse.org...
> I have an action that invokes an external tool on a set of files in a
> selection; this tool potentially modifies the files. I use exec() to
> invoke this external tool. Once this tool finishes I want to
> automatically refresh the workspace, just like the External Tool
> wizard allows one to do. I cannot simply call localRefresh() after
> the exec() call because exec returns immediately, so my refresh call
> would occur before the external tool finishes.
>
> Where do I make this call? Do I need a listener to do it? If so,
> how?
>
> Thanks very much.
>
> PS: I don't use the External Tool wizard for this because I need to
> pass multiple resources (files) to the external tool. Too, I want to
> have my own button and menu pull-down for it, but in any case I didn't
> see a way with the wizard to pass more than one resource. Did I miss
> something?
>
>
Re: how to refresh programmatically after exec()? [message #161036 is a reply to message #160821] Mon, 24 November 2003 16:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Darin Swanson wrote:
[snip]
> HTH

Thanks very much -- just what I was looking for!
Re: how to refresh programmatically after exec()? [message #167311 is a reply to message #160821] Mon, 08 December 2003 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Darin Swanson wrote:
[snip]
> You have two choices:
> You can busy wait for your process associated with your external
tool
> to terminate
> OR
> do your refreshing asychronously like the
BackgroundResourceRefresher.
> Essentially you need to register as a debug event listener to
trigger
> to refresh the resources when the process associated with your
> external tool terminates.

I'm going with the debug event listener approach and am getting an
error that I do not understand.

The log in .metadata says (among other things):

java.lang.NoClassDefFoundError:
org/eclipse/debug/core/IDebugEventSetListener
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at
org.eclipse.core.internal.boot.DelegatingURLClassLoader.find Class(Dele
gatingURLClassLoader.java:922)
at
org.eclipse.core.internal.plugins.PluginClassLoader.internal FindClassP
arentsSelf(PluginClassLoader.java:166)
at
org.eclipse.core.internal.boot.DelegatingURLClassLoader.find ClassParen
tsSelf(DelegatingURLClassLoader.java:485)
at
org.eclipse.core.internal.boot.DelegatingURLClassLoader.load Class(Dele
gatingURLClassLoader.java:882)
at
org.eclipse.core.internal.boot.DelegatingURLClassLoader.load Class(Dele
gatingURLClassLoader.java:862)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Does this represent an Eclipse environment setting that is not set?

In the Eclipse console output I get:

"Unhandled exception caught in event loop.
Reason:
org/eclipse/debug/core/IDebugEventSetListener"
Re: how to refresh programmatically after exec()? [message #167402 is a reply to message #167311] Mon, 08 December 2003 18:00 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
Looks like you forgot to add the runtime requirement of the Debug plugin for
your plugin.
Something like:

<requires>
<import plugin="org.eclipse.debug.core" />
</requires>

in your plugin.xml

HTH
Darins

"Pat Rogers" <progers@classwide.com> wrote in message
news:br26gf$8va$1@eclipse.org...
> Darin Swanson wrote:
> [snip]
> > You have two choices:
> > You can busy wait for your process associated with your external
> tool
> > to terminate
> > OR
> > do your refreshing asychronously like the
> BackgroundResourceRefresher.
> > Essentially you need to register as a debug event listener to
> trigger
> > to refresh the resources when the process associated with your
> > external tool terminates.
>
> I'm going with the debug event listener approach and am getting an
> error that I do not understand.
>
> The log in .metadata says (among other things):
>
> java.lang.NoClassDefFoundError:
> org/eclipse/debug/core/IDebugEventSetListener
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at
> org.eclipse.core.internal.boot.DelegatingURLClassLoader.find Class(Dele
> gatingURLClassLoader.java:922)
> at
> org.eclipse.core.internal.plugins.PluginClassLoader.internal FindClassP
> arentsSelf(PluginClassLoader.java:166)
> at
> org.eclipse.core.internal.boot.DelegatingURLClassLoader.find ClassParen
> tsSelf(DelegatingURLClassLoader.java:485)
> at
> org.eclipse.core.internal.boot.DelegatingURLClassLoader.load Class(Dele
> gatingURLClassLoader.java:882)
> at
> org.eclipse.core.internal.boot.DelegatingURLClassLoader.load Class(Dele
> gatingURLClassLoader.java:862)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> Does this represent an Eclipse environment setting that is not set?
>
> In the Eclipse console output I get:
>
> "Unhandled exception caught in event loop.
> Reason:
> org/eclipse/debug/core/IDebugEventSetListener"
>
>
Re: how to refresh programmatically after exec()? [message #167410 is a reply to message #167402] Mon, 08 December 2003 18:06 Go to previous message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Darin Swanson wrote:
> Looks like you forgot to add the runtime requirement of the Debug
> plugin for your plugin.
> Something like:

Yes, that did it. Thanks!
Previous Topic:Eclipse 3.0M5 install problem
Next Topic:Read-only region in editable StyledText
Goto Forum:
  


Current Time: Wed Sep 18 15:31:29 GMT 2024

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

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

Back to the top