/* $Id: MarkupAction.java 783 2013-10-22 13:07:54Z ohura $ */
package sml_editor.swingui.toolbar.action;

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

import sml_editor.swingui.EditorTextPane;
import sml_editor.swingui.MarkupDialog;


public class MarkupAction implements ActionListener{
	
	protected EditorTextPane textPane;
	
	protected MarkupDialog dialog;
	
	public void setEditorTextPane(EditorTextPane textPane){
		this.textPane = textPane;
	};
	public void actionPerformed(ActionEvent arg0) {
		int start = this.textPane.getSGSHTMLEditorTextPane().getSelectionStart();
		int end = this.textPane.getSGSHTMLEditorTextPane().getSelectionEnd();
		if(start == end){
			return;
		}
		this.dialog = new MarkupDialog(this.textPane,start,end);
		this.dialog.show();
	}
}
