Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Save dirty workbench in the background?
Save dirty workbench in the background? [message #559042] Wed, 15 September 2010 08:13 Go to next message
Anders Baumann is currently offline Anders Baumann
Messages: 55
Registered: July 2009
Member
Hi All.
When I close a dirty editor I would like it to be saved in the background.
Unfortunately I am unable to tell the Eclipse framework that my editor
should be saved in a background job. The method SaveableHelper#doSaveModel
asks the model for its backgroundSavejob. The model is of type
DefaultSaveable which is a simple wrapper for IWorkbenchPart. But how do I
actually set the backgroundSaveJob on this DefaultSaveable? Or how do I
return a different wrapper than DefaultSaveable? It seems like all the
relevant metods are private.

Thanks in advance,
Anders Baumann
Re: Save dirty workbench in the background? [message #559105 is a reply to message #559042] Wed, 15 September 2010 11:34 Go to previous messageGo to next message
Anders Baumann is currently offline Anders Baumann
Messages: 55
Registered: July 2009
Member
I found the answer here:
http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg18135.html

Best regards,
Anders

"Anders Baumann" <anb@maconomy.dk> wrote in message
news:i6qd97$sne$1@build.eclipse.org...
> Hi All.
> When I close a dirty editor I would like it to be saved in the background.
> Unfortunately I am unable to tell the Eclipse framework that my editor
> should be saved in a background job. The method SaveableHelper#doSaveModel
> asks the model for its backgroundSavejob. The model is of type
> DefaultSaveable which is a simple wrapper for IWorkbenchPart. But how do I
> actually set the backgroundSaveJob on this DefaultSaveable? Or how do I
> return a different wrapper than DefaultSaveable? It seems like all the
> relevant metods are private.
>
> Thanks in advance,
> Anders Baumann
>
Re: Save dirty workbench in the background? [message #559123 is a reply to message #559105] Wed, 15 September 2010 12:17 Go to previous messageGo to next message
Anders Baumann is currently offline Anders Baumann
Messages: 55
Registered: July 2009
Member
Or so I thought. My EditorPart class now implements ISaveablesSource and
saves now go through Saveable.doSave(). In this method I return a sub class
of Saveable. This class contains the method: IJobRunnable doSave(final
IProgressMonitor monitor, final IShellProvider shellProvider). According to
the documentation the IJobRunnable that is returned from this method will be
run in a background thread. However, this is actually not the case because
the method SaveableHelper#doSaveModel is called with a hard coded true value
for the parameter blockUntilSaved. When this parameter is true the
backgroundSaveRunnable will be run in the UI thread. How do I make the save
operation perform in a background job?

Thanks in advance,
Anders Baumann


"Anders Baumann" <anb@maconomy.dk> wrote in message
news:i6qp1q$qbp$1@build.eclipse.org...
>I found the answer here:
> http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg18135.html
>
> Best regards,
> Anders
>
> "Anders Baumann" <anb@maconomy.dk> wrote in message
> news:i6qd97$sne$1@build.eclipse.org...
>> Hi All.
>> When I close a dirty editor I would like it to be saved in the
>> background. Unfortunately I am unable to tell the Eclipse framework that
>> my editor should be saved in a background job. The method
>> SaveableHelper#doSaveModel asks the model for its backgroundSavejob. The
>> model is of type DefaultSaveable which is a simple wrapper for
>> IWorkbenchPart. But how do I actually set the backgroundSaveJob on this
>> DefaultSaveable? Or how do I return a different wrapper than
>> DefaultSaveable? It seems like all the relevant metods are private.
>>
>> Thanks in advance,
>> Anders Baumann
>>
>
>
Re: Save dirty workbench in the background? [message #559364 is a reply to message #559123] Thu, 16 September 2010 09:24 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Anders Baumann wrote:
> Or so I thought. My EditorPart class now implements ISaveablesSource and
> saves now go through Saveable.doSave(). In this method I return a sub class
> of Saveable. This class contains the method: IJobRunnable doSave(final
> IProgressMonitor monitor, final IShellProvider shellProvider). According to
> the documentation the IJobRunnable that is returned from this method will be
> run in a background thread. However, this is actually not the case because
> the method SaveableHelper#doSaveModel is called with a hard coded true value
> for the parameter blockUntilSaved. When this parameter is true the
> backgroundSaveRunnable will be run in the UI thread. How do I make the save
> operation perform in a background job?
>
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=202688

Dani
> Thanks in advance,
> Anders Baumann
>
>
> "Anders Baumann" <anb@maconomy.dk> wrote in message
> news:i6qp1q$qbp$1@build.eclipse.org...
>
>> I found the answer here:
>> http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg18135.html
>>
>> Best regards,
>> Anders
>>
>> "Anders Baumann" <anb@maconomy.dk> wrote in message
>> news:i6qd97$sne$1@build.eclipse.org...
>>
>>> Hi All.
>>> When I close a dirty editor I would like it to be saved in the
>>> background. Unfortunately I am unable to tell the Eclipse framework that
>>> my editor should be saved in a background job. The method
>>> SaveableHelper#doSaveModel asks the model for its backgroundSavejob. The
>>> model is of type DefaultSaveable which is a simple wrapper for
>>> IWorkbenchPart. But how do I actually set the backgroundSaveJob on this
>>> DefaultSaveable? Or how do I return a different wrapper than
>>> DefaultSaveable? It seems like all the relevant metods are private.
>>>
>>> Thanks in advance,
>>> Anders Baumann
>>>
>>>
>>
>
>
>
Previous Topic:Copy and paste problems in ToolBar Text widget
Next Topic:Clear workspace problem
Goto Forum:
  


Current Time: Thu Aug 28 01:34:33 EDT 2014

Powered by FUDForum. Page generated in 0.02744 seconds