treeViewer.getControl().addKeyListener(new KeyListener() { public void keyPressed(KeyEvent event) { if (event.character == SWT.DEL && event.stateMask == 0) { removeRootAction.run(); } } public void keyReleased(KeyEvent event) { } });
	protected void initializeListeners() {        getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this);		treeViewer.addSelectionChangedListener(removeRootAction);                // when F5 is pressed, refresh this view        treeViewer.getControl().addKeyListener(new KeyAdapter() {            public void keyPressed(KeyEvent event) {                if (event.keyCode == SWT.F5) {/*                    IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();                     if (selection.size() == 1)                     {                         getViewer().refresh(selection.getFirstElement());                          }        */                                       refreshAction.run();                }            }        });                treeViewer.addDoubleClickListener(new IDoubleClickListener() {            public void doubleClick(DoubleClickEvent e) {                handleDoubleClick(e);            }        });                       // when DEL is pressed, we remove the selected repository		treeViewer.getControl().addKeyListener(new KeyListener() {			public void keyPressed(KeyEvent event) {                if (event.character == SWT.DEL && event.stateMask == 0) {                    removeRootAction.run();                }			}			public void keyReleased(KeyEvent event) {			}		});	}