/* $Id: MarkupAction.java 439 2011-10-19 12:50:30Z shayashi $ */
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.getGSHTMLEditorTextPane().getSelectionStart();
		int end = this.textPane.getGSHTMLEditorTextPane().getSelectionEnd();
		if(start == end){
			return;
		}
		this.dialog = new MarkupDialog(this.textPane,start,end);
		this.dialog.show();
	}
}
