Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: AW: [cdt-dev] Programatically getting settings from the current project

Alain,

thanks again for your advice. Posting to the Display's event thread did the trick. 

The pre-filled attributes you wrote about in your earlier mail are not there in my environment. They are probably pre-filled when I use some CDT launch as base (which I am not doing).
Also I suspect that those attributes would not be updated if the launch were started via the shortcut instead of via the LCD.

I further suspect that what I am doing is CDT-specific after all since it relies on ManagedBuildManager.getBuildInfo() in order to get to the internals of the project information. Although I agree that the "outer" part, finding a view and figuring out the project in the workspace, is rather generic.

But at last I am where I want to be ... thanks!


Norbert

-----Ursprüngliche Nachricht-----
Von: cdt-dev-admin@xxxxxxxxxxx [mailto:cdt-dev-admin@xxxxxxxxxxx] Im Auftrag von Alain Magloire
Gesendet: Donnerstag, 3. März 2005 16:58
An: cdt-dev@xxxxxxxxxxx
Betreff: Re: AW: [cdt-dev] Programatically getting settings from the current project

> 
> Alain,
> 
> I worked around the issue I mentioned in my erlier email by using=20
> 
> 		IWorkbenchWindow[] windows =3D =
> PlatformUI.getWorkbench().getWorkbenchWindows();
> 		if (windows.length=3D=3D1) {
> 			IWorkbenchWindow window =3D windows[0];
> 			if (window !=3D null) {=20
> 			...
> 
> because I noticed that the length of the IWorkbenchWindow[] was 1 on my =
> desktop. Although I am not sure what I am doing ...
> 
> But there is another issue, further down in the code, when I try to get =
> the selection from the ISelectionProvider:
> 
> 						ISelection selection =3D selectionProvider.getSelection();
> 
> When I step over this line I get a CoreException ("Invalid thread =
> access"). So it seems there is no straightforward way to access GUI =
> components from the LauchConfigurationDelegate.
> 
> Any hints on this?
> 

In Eclipse, graphics calls have to be in the UI thread.
There is a strong dichotomy between Core vs UI
You will need to wrap you code in a runnable and post it the to the UI thread:
	Display.getCurrent().asyncExec(new Runnable() { ...});

But this may not be necessary see the previous post.

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top