/*
 *  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 org.openide.TopManager;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.openide.windows.Workspace;
import org.openide.windows.OutputWriter;

/** Action that can always be invoked and work procedurally.
 *
 * @author  devon
 */
public class InitiativeOpenAction extends CallableSystemAction {
    
    public void performAction() {
        // almost always need one of these:
        TopManager tm = TopManager.getDefault();

        // switch to the tutorial workspace
        // before popping the explorer:
        WindowManager wm = tm.getWindowManager();
        Workspace gamingWS = wm.findWorkspace("gaming"); //NOI18N
        if (gamingWS != null) {
            gamingWS.activate();
        }

        // get a node to explore (see OpenAPI javadocs), then
        // call convenience method TopManager.NodeOperation to explore:
        InitiativeTopWindow initiativeWin = new InitiativeTopWindow();
        initiativeWin.open();
    }
    
    public String getName() {
        return "Initiative Tracker"; //NOI18N
    }
    
    protected String iconResource() {
        return "/org/evilsoft/gaming/Init/Initiative.gif"; //NOI18N
    }
    
    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;
        // If you will provide context help then use:
        // return new HelpCtx (TutorialOpenAction.class);
    }
    
    /** Perform extra initialization of this action's singleton.
     * PLEASE do not use constructors for this purpose!
     * protected void initialize () {
     * super.initialize ();
     * putProperty (Action.SHORT_DESCRIPTION, NbBundle.getMessage (TutorialOpenAction.class, "HINT_Action"));
     * }
     */
    
}
