/* $Id: UndoAction.java 125 2011-03-09 09:49:51Z ohura $ */
package sml_editor.swingui.toolbar.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import sml_editor.swingui.EditorTextPane;


public class UndoAction implements ActionListener{
	private EditorTextPane textPane;
	protected boolean keyevent = true;
	public UndoAction() {
	
	}
	public UndoAction(EditorTextPane textPane){
		this.textPane = textPane;
		if(textPane != null){
			this.textPane.getUndoAction().setKeyEvent(keyevent);
		}
	}
	public void setKeyEvent(boolean keyevent){
		this.keyevent = keyevent;
	}
	public void setEditorTextPane(EditorTextPane textPane){
		this.textPane = textPane;
		if(textPane != null){
			this.textPane.getUndoAction().setKeyEvent(keyevent);
		}
	}
	public void actionPerformed(ActionEvent e) {
//		this.textPane.getGSHTMLEditorTextPane().getController().undo();
		if(textPane != null){
			this.textPane.getUndoAction().actionPerformed(e);
		}
	}
}
