/*
 * 作成日: 2005/09/25
 */
package asandatabasebrowser.action;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import asandatabasebrowser.Global;
import asandatabasebrowser.view.IMenuEnable;
import asandatabasebrowser.view.JTabbedTextArea;



public class TabRemoveAction  extends AbstractAction {
	JTabbedTextArea tab;
	public TabRemoveAction(JTabbedTextArea tab) {
		super("RemoveTab");
		putValue(SHORT_DESCRIPTION, "タブを削除");
		putValue(LONG_DESCRIPTION, "タブを削除");
		putValue(SMALL_ICON, Global.getImageIcon("/resources/Tab_delete.png"));
		this.tab = tab;
	}

    public void actionPerformed(ActionEvent ev) {
    	tab.removeTextArea();
    	if (tab.getTopLevelAncestor() instanceof IMenuEnable) {
    		IMenuEnable frame = (IMenuEnable) tab.getTopLevelAncestor();
	    	frame.updateActionState();
    	}
    }
}

