/*
Tiamat - a role-playing game framework
ConfigurationNavigationEventHandler.java - handles configuration files in the project

Copyright  (C) 2006 Hugues Johnson

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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

package com.huguesjohnson.tiamat.tools.adventureStudio.event;

import javax.swing.filechooser.FileFilter;

import com.huguesjohnson.fileFilter.XmlFileFilter;
import com.huguesjohnson.tiamat.tools.BaseEditorFrame;
import com.huguesjohnson.tiamat.tools.ConfigurationEditorFrame;
import com.huguesjohnson.tiamat.tools.adventureStudio.NavigationTreeNode;

public class ConfigurationNavigationEventHandler extends NavigationEventHandler{

	public ConfigurationNavigationEventHandler(String targetDir){
		this.setTargetDir(targetDir);
	}

	public ConfigurationNavigationEventHandler(String targetDir,String fileName){
		this.setTargetDir(targetDir);
		this.setFileName(fileName);
	}	
	
	public boolean canEdit(){
		if(this.getFileName()==null){ //then this is a root node
			return(false);
		}
		return(true);
	}
	public BaseEditorFrame onEdit(){
		ConfigurationEditorFrame editor=new ConfigurationEditorFrame("Configuration",this.getFilePath());
		return(editor);
	}

	public boolean canAdd(){ return(false); }
	public NavigationTreeNode onAdd(){ return(null); }

	public boolean canRemove(){ return(false); }
	public void onRemove(){ }

	public boolean canRename(){ return(false); }
	public void onRename(){ }

	public FileFilter getFilter(){
		return(new XmlFileFilter());
	}
}