ISelection selection = viewer.getSelection();
Object obj = ((IStructuredSelection)selection).getFirstElement();
if (obj != null) {
String param = Controller.getInstance().getPreferenceStore().getString(PreferenceConstants.PLAYLISTSVIEW_DOUBLECLICK_ACTION);
if (param.equals("2")) { //$NON-NLS-1$
new OpenAndPlayPlaylistAction(((Playlist) obj).getName()).run();
} else if (param.equals("1")) { //$NON-NLS-1$
new PlayPlaylistAction(((Playlist) obj).getName()).run();
} else {
new OpenPlaylistAction(((Playlist) obj).getName()).run();
}