Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Messages.get() within IRunnableWithProgress
Messages.get() within IRunnableWithProgress [message #119831] Tue, 27 January 2009 13:14 Go to next message
Eclipse UserFriend
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 05:40 Go to previous messageGo to next message
Eclipse UserFriend
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 08:08 Go to previous messageGo to next message
Eclipse UserFriend
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 10:12 Go to previous messageGo to next message
Eclipse UserFriend
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 08:39 Go to previous message
Eclipse UserFriend
Hi R
Previous Topic:Changing default Font / Theming
Next Topic:Clipboard workaround
Goto Forum:
  


Current Time: Wed May 07 22:05:27 EDT 2025

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

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

Back to the top