|Re: [cdt-dev] Get Active Project|
How are you triggering/running kconfig? Are you using some kind of actionSet or popupMenu? If yes you implement some interface like IWorkbenchWindowActionDelegate or IObjectActionDelegate in one of your classes. Both have a selectionChanged(IAction action, ISelection selection) method you have to override (which will be called when triggered). The passed selection is, depending on what is currently selected an instance of either IStructuredSelection ( -> selection in "Project Explorer" or "C++ Projects" view on project/folder/file/etc) or ITextSelection ( -> selection in editor).
In the first case you can use the structuredSelection.getFirstElement() to get some resource (ITranslationUnit/IProject/IContainer/IFile). In the second case use "PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput()" to get the editor reference. It normally hase the type FileEditorInput which provides a getFile() method.
Hope this helps!
On 13.11.2012 20:46, Jason Litton wrote: