selctionchanged not trigering for Project Explorer Item Selection [message #772713] |
Fri, 30 December 2011 12:04 |
|
I have Created a new View (PC Lint Reader ). I want this vew to respond
As a Project from the Project Explorer (Eclipse Navigator) is selected.
So I have added a getSite().setSelectionProvider(viewer); in the
createpartcontrol. Below is how my selectionChanged looks like.
The problem is the selectionChanged(...)implemantation in the editor
(implementing ISelectionListener) never fires.
I had same code with older Eclipse and it worked, but after changing my project to use INDIGO selctionchanged stopped firing.
Intresting : If i close the project then selectionChanged does get fired.
but when i open the project it doenot.
Can someone help me undertand what is going on ?
public void selectionChanged(IWorkbenchPart part, ISelection selection)
{
IStructuredSelection selected = (IStructuredSelection) selection;
itemSelected = selected.toArray();
for (Object item : itemSelected)
{
if (item instanceof IProject)
{
File dir = (((IProject) item).getLocation().toFile());
StringBuffer currentProject = new StringBuffer();
currentProject.append(dir.getAbsolutePath());
currentProject.append(File.separator);
currentProject.append("source");
currentProject.append(File.separator);
currentProject.append("LintErrors.txt");
ModelProvider.INSTANCE.setCurrentFile(currentProject.toString());
viewer.setInput(ModelProvider.INSTANCE.getLintElements());
}
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03850 seconds