/*
 * $Id: SaveAsAction.java 3067 2008-02-14 19:16:15Z uckelman $
 *
 * Copyright (c) 2000-2003 by Rodney Kinney
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License (LGPL) as published by the Free Software Foundation.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, copies are available 
 * at http://www.opensource.org.
 */
package VASSAL.configure;

import java.net.URL;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;

import VASSAL.i18n.Resources;

/**
 * General-purpose "Save As" action
 */
public abstract class SaveAsAction extends AbstractAction {
  protected String parentType = "";
  public SaveAsAction() {
    final URL iconURL = getClass().getResource("/images/SaveAs16.gif");
    if (iconURL != null) {
      putValue(Action.SMALL_ICON, new ImageIcon(iconURL));
    }

    putValue(Action.NAME, Resources.getString("Editor.save_as", parentType));
    putValue(Action.SHORT_DESCRIPTION, Resources.getString("Editor.save_as", parentType));
  }
  
  public void setParent(String p) {
    parentType = p;
  }
}
