/*
 *  Initiative - A role playing utility to track turns
 *  Copyright (C) 2002 Devon D Jones
 *
 *  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.
 *
 *  The author of this program grants you the ability to use this code
 *  in conjunction with code that is covered under the Open Gaming License
 *
 */
package org.evilsoft.gaming.Init;

import java.io.IOException;

import org.openide.actions.*;
import org.openide.filesystems.*;
import org.openide.loaders.*;
import org.openide.util.NbBundle;
import org.openide.util.actions.SystemAction;

/** Recognizes single files in the Repository as being of a certain type.
 *
 * @author devon
 */
public class InitiativeDataLoader extends UniFileLoader {
    
    public InitiativeDataLoader() {
        this("org.evilsoft.gaming.Init.InitiativeDataObject");
    }
    
    // Can be useful for subclasses:
    protected InitiativeDataLoader(String recognizedObjectClass) {
        super(recognizedObjectClass);
    }
    
    protected String defaultDisplayName() {
        return "Character/Party";
    }
    
    protected void initialize()
    {
        super.initialize();
        
        ExtensionList extensions = new ExtensionList();
        extensions.addExtension("init");
        setExtensions(extensions);
        setActions(new SystemAction[] {
            SystemAction.get(OpenAction.class),
        });
    }
    
    protected SystemAction[] defaultActions() {
        return new SystemAction[] {
            SystemAction.get(OpenAction.class),
            // SystemAction.get (CustomizeBeanAction.class),
            SystemAction.get(FileSystemAction.class),
            null,
            /*
            SystemAction.get (CompileAction.class),
            null,
            SystemAction.get (BuildAction.class),
            null,
            SystemAction.get (ExecuteAction.class),
            null,
             */
            SystemAction.get(CutAction.class),
            SystemAction.get(CopyAction.class),
            SystemAction.get(PasteAction.class),
            null,
            SystemAction.get(DeleteAction.class),
            SystemAction.get(RenameAction.class),
            null,
            SystemAction.get(SaveAsTemplateAction.class),
            null,
            SystemAction.get(ToolsAction.class),
            SystemAction.get(PropertiesAction.class),
        };
    }
    
    protected MultiDataObject createMultiObject(FileObject primaryFile)
    throws DataObjectExistsException, IOException {
        return new InitiativeDataObject(primaryFile, this);
    }
    
    // Additional user-configurable properties:
    /*
    public String getMyProp () {
        return (String) getProperty ("myProp");
    }
    public void setMyProp (String nue) {
        putProperty ("myProp", nue, true);
    }
    public void writeExternal (ObjectOutput out) throws IOException {
        super.writeExternal (out);
        out.writeUTF (getMyProp ());
    }
    public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal (in);
        setMyProp (in.readUTF ());
    }
     */
    
}
