I have created a array list and when the list item is selected using mouse down event a listener has to be added for it so how can this be done .The code for which i have created the array list ia as follows
final java.util.List<Object> listSort = new ArrayList<>();
for(String key: descriptionMappernewer.keySet())
listSort.add(key);
final MyFilter filter = new MyFilter();
final ListViewer viewer = new ListViewer(this);
//viewer.getList();
viewer.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
//viewer.getList();
viewer.setContentProvider(new ArrayContentProvider());
viewer.setInput(listSort);
and now I need to add mouse down event listener for it. Earlier I had written the mouse event listener of SWT but that has to changed now. The earlier SWT listener looks like this
list.addListener(SWT.Selection, new Listener(){
public void handleEvent(Event e) {
int index = list.getSelectionIndex();
txtMethodDescription.setText(descriptionMappernewer.get( list.getItem(index)));
}
});
So please help me how can we add the listener to array list of java.util.List