/*
 Tiamat - a role-playing game framework
 NavigationEventHandler.java - used to handle events in the navigation panel tree
 
 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 java.io.File;
import javax.swing.filechooser.FileFilter;

import com.huguesjohnson.tiamat.tools.BaseEditorFrame;
import com.huguesjohnson.tiamat.tools.adventureStudio.NavigationTreeNode;

/** NavigationEventHandler - used to handle events in the navigation panel tree
 * @author Hugues Johnson
 */
public abstract class NavigationEventHandler{
	private boolean cancel;
	public boolean getCancel(){ return(this.cancel); }
	protected void setCancel(boolean cancel){ this.cancel=cancel; }
	
	private String fileName;
	public String getFileName(){ return(this.fileName); }
	protected void setFileName(String fileName){
		this.fileName=new String(fileName);
	}
	
	private String targetDir;
	public String getTargetDir(){ return(this.targetDir); }
	protected void setTargetDir(String targetDir){
		if(!targetDir.endsWith(File.separator)){
			targetDir=targetDir+File.separator;
		}
		this.targetDir=new String(targetDir);
	}	
	
	public String getFilePath(){ 
		if((this.targetDir==null)||(this.fileName==null)){
			return(null);
		}
		return(this.targetDir+this.fileName); 
	}
	
	//returns the FileFilter for supported files
	public abstract FileFilter getFilter();
	
	public abstract boolean canEdit();
	public abstract BaseEditorFrame onEdit();
	
	public abstract boolean canAdd();
	public abstract NavigationTreeNode onAdd();
	
	public abstract boolean canRemove();
	public abstract void onRemove();
	
	public abstract boolean canRename();
	public abstract void onRename();
}