Skip to main content

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

> Alain,
> thanks a lot for your support. Your response, together with that of =
> Chris helped me a lot.=20
> There is one catch: I need to figure out to currently selected project =
> when running inside the launch configuration delegate's launch() method, =
> and in this place I can't do=20
> 	IWorkbenchWindow window =3D =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> because getActiveWorkbenchWindow() returns null.
> Can you help me out?

The CDT launch configuration comes with a certain number of pre-fill attributes
In your case you would need:

public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {

  String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);

See the org.eclipse.cdt.launch plugin for more details and for more depth docs on the launch from Eclipse.

Back to the top