private MouseAdapter createPlaylistTreeMouseListener()
	{
		return new MouseAdapter()
		{
			@Override
			public void mousePressed(MouseEvent e)
			{
				handleMouseEvent(e);
			}

			@Override
			public void mouseReleased(MouseEvent e)
			{
				handleMouseEvent(e);
			}

			private void handleMouseEvent(MouseEvent e)
			{
				Point p = e.getPoint();
				if (e.isPopupTrigger())
				{
					int rowIx = _playlistDirectoryTree.getRowForLocation(p.x, p.y);
					boolean isOverItem = rowIx >= 0;
					if (isOverItem && (e.getModifiers() & ActionEvent.CTRL_MASK) > 0)
					{
						_playlistDirectoryTree.addSelectionRow(rowIx);
					}
					else
					{
						if (isOverItem && !_playlistDirectoryTree.isRowSelected(rowIx))
						{
							_playlistDirectoryTree.setSelectionRow(rowIx);
						}
					}

					if (_playlistDirectoryTree.getSelectionCount() > 0)
					{
						_miExactMatchesSearch.setEnabled(true);
						_miClosestMatchesSearch.setEnabled(true);
						_miOpenSelectedPlaylists.setEnabled(true);
						_miDeletePlaylist.setEnabled(true);
						if (_playlistDirectoryTree.getSelectionCount() == 1)
						{
							_miRenameSelectedItem.setEnabled(true);
						}
					}
					else
					{
						_miExactMatchesSearch.setEnabled(false);
						_miClosestMatchesSearch.setEnabled(false);
						_miOpenSelectedPlaylists.setEnabled(false);
						_miDeletePlaylist.setEnabled(false);
						_miRenameSelectedItem.setEnabled(false);
					}

					_miRefreshDirectoryTree.setEnabled(_playlistDirectoryTree.getRowCount() > 0);
					_playlistTreeRightClickMenu.show(e.getComponent(), p.x, p.y);
				}
				else
				{
					int selRow = _playlistDirectoryTree.getRowForLocation(p.x, p.y);
					TreePath selPath = _playlistDirectoryTree.getPathForLocation(p.x, p.y);
					if (selRow != -1)
					{
						if (e.getClickCount() == 2)
						{
							playlistDirectoryTreeNodeDoubleClicked(selPath);
						}
					}
					else
					{
						_playlistDirectoryTree.setSelectionRow(-1);
					}
				}
			}
		};
	}