Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Messages.get() within IRunnableWithProgress
Messages.get() within IRunnableWithProgress [message #119831] Tue, 27 January 2009 18:14 Go to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,
I have a wizard that does some long runnning operation in method
"performFinish".
This is currently doen with the following call:
getContainer().run(true, true, new IRunnableWithProgress() {

public void run(IProgressMonitor monitor) throws InvocationTargetException {

monitor.beginTask(Messages.get().myText, IProgressMonitor.UNKNOWN);

}

The call to Messages.get() raises the following exception:

java.lang.IllegalStateException: No context available outside of the request
service lifecycle.

Is there any solution to this or am I doing something wrong?

Regards,

Markus
Re: Messages.get() within IRunnableWithProgress [message #119988 is a reply to message #119831] Thu, 29 January 2009 10:40 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Markus,

your code tries to access session-information but isn't run from the
UI thread (the only thread that has a session context associated by
default).

The soltion is to wrap your code in a Runnable and have it executed
by UICallBack#runNonUIThreadWithFakeContext().

Please also see this thread:
http://dev.eclipse.org/newslists/news.eclipse.technology.rap /msg01311.html

HTH
Rüdiger



Markus Krüger wrote:
> Hi,
> I have a wizard that does some long runnning operation in method
> "performFinish".
> This is currently doen with the following call:
> getContainer().run(true, true, new IRunnableWithProgress() {
>
> public void run(IProgressMonitor monitor) throws InvocationTargetException {
>
> monitor.beginTask(Messages.get().myText, IProgressMonitor.UNKNOWN);
>
> }
>
> The call to Messages.get() raises the following exception:
>
> java.lang.IllegalStateException: No context available outside of the request
> service lifecycle.
>
> Is there any solution to this or am I doing something wrong?
>
> Regards,
>
> Markus
>
>
Re: Messages.get() within IRunnableWithProgress [message #120170 is a reply to message #119988] Fri, 30 January 2009 13:08 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,

can I always do this in the class Messages of my plugin?

Regards,
Markus

"R
Re: Messages.get() within IRunnableWithProgress [message #120314 is a reply to message #120170] Tue, 03 February 2009 15:12 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Markus,

if you read the method signature, you will know the answer: very
unlikely. The method requires a disply to be passed in and this
isn't usually available in your Messages implementation.

HTH
Rüdiger

Markus Krüger wrote:
> Hi,
>
> can I always do this in the class Messages of my plugin?
>
> Regards,
> Markus
>
> "Rüdiger Herrmann" <rherrmann@eclipsesource.com> schrieb im Newsbeitrag
> news:gls12f$4dv$1@build.eclipse.org...
>> Markus,
>>
>> your code tries to access session-information but isn't run from the UI
>> thread (the only thread that has a session context associated by default).
>>
>> The soltion is to wrap your code in a Runnable and have it executed by
>> UICallBack#runNonUIThreadWithFakeContext().
>>
>> Please also see this thread:
>> http://dev.eclipse.org/newslists/news.eclipse.technology.rap /msg01311.html
>>
>> HTH
>> Rüdiger
>>
>>
>>
>> Markus Krüger wrote:
>>> Hi,
>>> I have a wizard that does some long runnning operation in method
>>> "performFinish".
>>> This is currently doen with the following call:
>>> getContainer().run(true, true, new IRunnableWithProgress() {
>>>
>>> public void run(IProgressMonitor monitor) throws
>>> InvocationTargetException {
>>>
>>> monitor.beginTask(Messages.get().myText, IProgressMonitor.UNKNOWN);
>>>
>>> }
>>>
>>> The call to Messages.get() raises the following exception:
>>>
>>> java.lang.IllegalStateException: No context available outside of the
>>> request service lifecycle.
>>>
>>> Is there any solution to this or am I doing something wrong?
>>>
>>> Regards,
>>>
>>> Markus
>>>
>
Re: Messages.get() within IRunnableWithProgress [message #120434 is a reply to message #120314] Wed, 04 February 2009 13:39 Go to previous message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi R
Previous Topic:Changing default Font / Theming
Next Topic:Clipboard workaround
Goto Forum:
  


Current Time: Tue Dec 07 19:26:47 GMT 2021

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

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

Back to the top