public void registerTreeListener(String label, final JTree tree)
    {
    	if(AbstractBagConstants.DATA_DIRECTORY.equals(label))
    	{
    		tree.addTreeSelectionListener(new TreeSelectionListener() {

    			public void valueChanged(TreeSelectionEvent e) {

    				TreePath[] paths = tree.getSelectionPaths();
    				if(paths == null || paths.length == 0)
    					return;

    				for(TreePath path: paths)
    				{
    					if(path.getPathCount() == 1)
    					{
    						removeDataToolBarAction.setEnabled(false);
    						return;
    					}
    				}

    				removeDataToolBarAction.setEnabled(true);
    			}
    		});
    	}
    	else 
    	{
    		tree.addTreeSelectionListener(new TreeSelectionListener() {

    			public void valueChanged(TreeSelectionEvent e) {

    				TreePath[] paths = tree.getSelectionPaths();
    				if(paths == null || paths.length == 0)
    					return;

    				for(TreePath path: paths)
    				{
    					if(path.getPathCount() == 1)
    					{
    						removeTagFileToolbarAction.setEnabled(false);
    						return;
    					}
    				}

    				removeTagFileToolbarAction.setEnabled(true);
    			}
    		});
    	}
    }