|
|
|
Re: showPerspective send a "invalid access thread" [message #329431 is a reply to message #329409] |
Tue, 24 June 2008 08:13 |
Prakash G.R. Messages: 621 Registered: July 2009 |
Senior Member |
|
|
julien,
Ideally you shouldn't be doing this at all. Switching to the debug
perspective is done by the workbench automatically. The behaviour is
controlled by the preference: Run/Debug->Perspective->Open the
associated perspective when lauching.
- Prakash
www.eclipse-tips.com
julien wrote:
> Rahul Kamdar a écrit :
>> Hi Julien,
>>
>> The call that you are making is a UI call. And it should be invoked on
>> the UI thread I think. You could try doing
>> PlatformUI.getWorkbench().getDisplay().asyncExec/syncExec(Ru nnable)
>> and putting your code inside this runnable and then try invoking again.
>>
>> Rahul
>
> yeah, thats work thanks a lot
>
>
> A+++
>>
>>
>> "julien" <elekis@gmail.com> wrote in message
>> news:g3m6b9$t3i$1@build.eclipse.org...
>>> hi,
>>>
>>> in my code (in a LaunchConfigurationDelegate subclasses) I try to
>>> change the perspective to get the debugperspective so I use this.
>>>
>>> PlatformUI.getWorkbench().showPerspective(
>>> IDebugUIConstants.ID_DEBUG_PERSPECTIVE,
>>> PlatformUI.getWorkbench().getActiveWorkbenchWindow()
>>> );
>>>
>>> but I have an invalid access thread And I have no idea why.
>>>
>>> there the full code
>>>
>>>
>>> try {
>>> if (mode.equals(ILaunchManager.DEBUG_MODE)) {
>>> PlatformUI.getWorkbench().showPerspective(
>>> IDebugUIConstants.ID_DEBUG_PERSPECTIVE,
>>> PlatformUI.getWorkbench().getActiveWorkbenchWindow());
>>> command = "cmd.exe /C \"set YINPUT=1
>>> && set YDEBUG=1 && "
>>> + command + "\"";
>>> }
>>>
>>> System.out.println(command);
>>> Process process = Runtime.getRuntime().exec(command);
>>> IProcess p = DebugPlugin.newProcess(launch, process, path
>>> .removeLastSegments(1).toOSString());
>>> launch.addProcess(p);
>>> if (mode.equals(ILaunchManager.DEBUG_MODE)) {
>>> IDebugTarget target = new YaflDebugTarget(launch, p);
>>> launch.addDebugTarget(target);
>>> }
>>> } catch (IOException e) {
>>> e.printStackTrace();
>>> }
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03986 seconds