|Label provider and icons from workspace [message #557851]
||Thu, 09 September 2010 08:41
| Michal Borek
Registered: August 2010
I've got a problem creating LabelProvider that returs Image chosen by user (from his project workspace).
I've got element Icon with attribute "path".
I need project relative path, so I need to get project. I don't know how, because LabelProvider doesn't have IProject element. When I use
IEditorPart editorPart = WidgetsActivator.getDefault().getWorkbench().getActiveWorkbenchWindow()
IFileEditorInput input = (IFileEditorInput) editorPart.getEditorInput();
IProject activeProject = input.getFile().getProject();
I've got null pointer exception when loading eclipse and there is active tab which using this label provider (but if tab is closed after eclipse start I open this editor, everything's fine).
Could you please tell me how to get project which is parent of file for which this editor is opened ?
Powered by FUDForum
. Page generated in 0.09528 seconds