if(mFavoriteTree.getSelectionPath() != null && ((FavoriteNode)mFavoriteTree.getSelectionPath().getLastPathComponent()).containsFavorite()) {
selection = 0;
}
}
if (selection != -1) {
Favorite fav;
FavoriteNode parent = null;
if(mFavoritesList != null) {
fav = (Favorite) mFavoritesListModel.get(selection);
mFavoritesListModel.remove(selection);
}
else {
FavoriteNode node = ((FavoriteNode)mFavoriteTree.getSelectionPath().getLastPathComponent());
fav = node.getFavorite();
parent = (FavoriteNode) node.getParent();
}
if (JOptionPane.showConfirmDialog(this,
FavoritesPlugin.mLocalizer.msg("reallyDelete", "Really delete favorite '{0}'?", fav.getName()),
mLocalizer.msg("delete", "Delete selected favorite..."),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
FavoriteTreeModel.getInstance().deleteFavorite(fav);