Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Progress on do save
Progress on do save [message #130895] Thu, 30 April 2009 13:53 Go to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,

i created an edit with "save" and "save as..." possible. Now since the
"save" needs some time I actually expected a progress monitor to show up or
see the progress in the status line (status line is activated). There is no
progress shown at all, just a cursor indicating that it is busy.

Is this a bug (did a search, but could not find one related to it), or am I
doing something wrong?

You can implement the following mehtods is FooEditor of the Demo:
@Override

public void doSave( final IProgressMonitor monitor ) {

monitor.beginTask( "Saveing...", IProgressMonitor.UNKNOWN );

try {

Thread.sleep( 10000 );

} catch( InterruptedException exception ) {

// TODO Auto-generated catch block

exception.printStackTrace();

}

editor.setDirty( false );

treeeditor.setDirty( false );

monitor.done();

}


@Override

public void doSaveAs() {

try {

getSite().getWorkbenchWindow().run( false,

false,

new IRunnableWithProgress() {


public void run( IProgressMonitor monitor )

throws InvocationTargetException,

InterruptedException

{

doSave( monitor );

}

} );

} catch( InvocationTargetException exception ) {

// TODO Auto-generated catch block

exception.printStackTrace();

} catch( InterruptedException exception ) {

// TODO Auto-generated catch block

exception.printStackTrace();

}

}
Re: Progress on do save [message #131111 is a reply to message #130895] Mon, 04 May 2009 14:24 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
No ideas?

"Markus Kr
Re: Progress on do save [message #131293 is a reply to message #130895] Tue, 05 May 2009 06:54 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
one would run the actual save operation in a job/background thread.
Think of your code in RCP, the UI would freeze if you run a long
running operation in the UI thread.

Markus Krüger wrote:
> Hi,
>
> i created an edit with "save" and "save as..." possible. Now since the
> "save" needs some time I actually expected a progress monitor to show up or
> see the progress in the status line (status line is activated). There is no
> progress shown at all, just a cursor indicating that it is busy.
>
> Is this a bug (did a search, but could not find one related to it), or am I
> doing something wrong?
>
> You can implement the following mehtods is FooEditor of the Demo:
> @Override
>
> public void doSave( final IProgressMonitor monitor ) {
>
> monitor.beginTask( "Saveing...", IProgressMonitor.UNKNOWN );
>
> try {
>
> Thread.sleep( 10000 );
>
> } catch( InterruptedException exception ) {
>
> // TODO Auto-generated catch block
>
> exception.printStackTrace();
>
> }
>
> editor.setDirty( false );
>
> treeeditor.setDirty( false );
>
> monitor.done();
>
> }
>
>
> @Override
>
> public void doSaveAs() {
>
> try {
>
> getSite().getWorkbenchWindow().run( false,
>
> false,
>
> new IRunnableWithProgress() {
>
>
> public void run( IProgressMonitor monitor )
>
> throws InvocationTargetException,
>
> InterruptedException
>
> {
>
> doSave( monitor );
>
> }
>
> } );
>
> } catch( InvocationTargetException exception ) {
>
> // TODO Auto-generated catch block
>
> exception.printStackTrace();
>
> } catch( InterruptedException exception ) {
>
> // TODO Auto-generated catch block
>
> exception.printStackTrace();
>
> }
>
> }
>
>
Re: Progress on do save [message #131389 is a reply to message #131293] Tue, 05 May 2009 09:27 Go to previous message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Well, since the method "save" takes an IProgressMonitor as argument I thinkt
this is already a background thread, isn't it?
I could not find an example for an implementation of the method save.

"R
Previous Topic:problems with upload widget
Next Topic:Usability and architecture questions
Goto Forum:
  


Current Time: Sat Feb 04 23:12:11 GMT 2023

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

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

Back to the top