protected void notifyListeners() {
if( Display.getCurrent()==null ){
final ISelectionProvider p=this;
Display.getDefault().asyncExec(new Runnable(){
public void run() {
SelectionChangedEvent event=new SelectionChangedEvent(p, selection);
for( ISelectionChangedListener l : listeners ) {
l.selectionChanged(event);
}
}
});
}else{
SelectionChangedEvent event=new SelectionChangedEvent(this, selection);
for( ISelectionChangedListener l : listeners ) {
l.selectionChanged(event);
}
}
}