Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » plugin asyncronized running
plugin asyncronized running [message #47280] Sat, 24 May 2003 20:10 Go to next message
Eclipse UserFriend
Originally posted by: max.j2biz.com

hi all!

i'm trying to write a small plugin, that flushes a contents of a big
text-files within my TextView.
but during reading and flushing some file int? view, eclipse freezes.

i do it as follows:

public void execute(){
Display display = Display.getCurrent();
display.syncExec(aSyncRunnable = new Runnable() {
public void run() {
executeFlush();
aSyncRunnable = null;
}
});
}

The executeFlush()-Function creates an BufferedReader for a text-file to
read..
can anybody help me?
thank you..
max
Re: plugin asyncronized running [message #47527 is a reply to message #47280] Sun, 25 May 2003 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: d.wegener(spamblock).attbi.com

By performing the syncExec, you are executing the process on the SWT GUI
thread. This prevents any other events from being processed while the
process is running.

In stead of running the process on the GUI thread, you should create your
own thread, passing in the runnable and then start the thread.

Something along the lines of:
Thread backgroundThread = new Thread() {
public void run() {
executeFlush();
}
};
backgroundThread.start();

"Max Kalina" <max@j2biz.com> wrote in message
news:bap1m8$pj0$1@rogue.oti.com...
> hi all!
>
> i'm trying to write a small plugin, that flushes a contents of a big
> text-files within my TextView.
> but during reading and flushing some file int? view, eclipse freezes.
>
> i do it as follows:
>
> public void execute(){
> Display display = Display.getCurrent();
> display.syncExec(aSyncRunnable = new Runnable() {
> public void run() {
> executeFlush();
> aSyncRunnable = null;
> }
> });
> }
>
> The executeFlush()-Function creates an BufferedReader for a text-file to
> read..
> can anybody help me?
> thank you..
> max
>
>
>
Previous Topic:Profile launch button in 3.0 stream
Next Topic:Rules and Text
Goto Forum:
  


Current Time: Sun Apr 27 02:49:23 EDT 2025

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

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

Back to the top