/**
 *############################################################################
 * A component of the Greenstone Librarian Interface, part of the Greenstone
 * digital library suite from the New Zealand Digital Library Project at the
 * University of Waikato, New Zealand.
 *
 * Author: Michael Dewsnip, NZDL Project, University of Waikato, NZ
 *
 * Copyright (C) 2004 New Zealand Digital Library Project
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *############################################################################
 */

package org.greenstone.gatherer.collection;


import java.io.*;
import javax.swing.*;
import org.greenstone.gatherer.cdm.CollectionDesignManager;
import org.greenstone.gatherer.file.FileNode;
import org.greenstone.gatherer.util.JarTools;


/** This class represents one node in the collection tree. */
public class CollectionTreeNode
    extends FileNode
{
    static final public ImageIcon GREEN_FILE_ICON = JarTools.getImage("greenfile.gif", true);

    /** Is this file a metadata database that is explodable with the explode_metadata_databases.pl script? */
    private boolean is_explodable = false;


    public CollectionTreeNode(File file)
    {
	super(file);

	this.is_explodable = CollectionDesignManager.plugin_manager.isFileExplodable(file);
    }


    public FileNode addChildNode(File file)
    {
	CollectionTreeNode child_node = new CollectionTreeNode(file);
	child_node.setModel(model);
	child_node.setParent(this);
	return child_node;
    }


    public boolean isExplodable()
    {
	return is_explodable;
    }
}
