Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » selctionchanged not trigering for Project Explorer Item Selection(ISelectionListener - Project Explorer - Eclipse Indigo)
icon5.gif  selctionchanged not trigering for Project Explorer Item Selection [message #772713] Fri, 30 December 2011 12:04
Manish Saha is currently offline Manish SahaFriend
Messages: 1
Registered: December 2011
Location: Pune
Junior Member
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());
}
}
}
Previous Topic:Catching selection change event of Stack Frames
Next Topic:flattenDependencies
Goto Forum:
  


Current Time: Thu Sep 26 03:13:09 GMT 2024

Powered by FUDForum. Page generated in 0.03850 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top