public void actionPerformed(ActionEvent e){
String cmd = e.getActionCommand();
if(cmd.equals("delete")){
Object obj = list.getSelectedValue();
if(obj != null && obj instanceof IResource){
IResource r = (IResource) obj;
int k = JOptionPane.showConfirmDialog(list,"Are you sure you want to delete "+r);
if(k == JOptionPane.YES_OPTION){
r.delete();
}
}
}
}