package com.ht.svg.action;

import java.util.HashSet;
import java.util.Set;

import javafx.event.EventHandler;
import netscape.javascript.JSException;

import org.w3c.dom.Element;
import org.w3c.dom.events.Event;

import com.ht.svg.animat.SVGAnimationOnExpression;
import com.ht.svg.util.DomUtil;
import com.ht.ui.MainApplication;
import com.ht.ui.controls.window.MessageDialog;

/**
 * the abstract class of the run application action
 * 
 * @author ITRIS, Jordi SUC
 */
public class BlinkingResetAction extends AbstractActionListener {

	/**
	 * the constructor of the class
	 * 
	 * @param actionElement
	 *            the dom element defining the action
	 */
	public BlinkingResetAction(Element actionElement) {

		super(actionElement);
	}

	@Override
	public void performAction(Event event) {

		if (confirmationMessage == null || confirmationMessage.isEmpty()) {
			getActionsHandler().getSvgViewer().blinkingReset();
		} else {

			MessageDialog.buildConfirmation("提示", confirmationMessage,
					new EventHandler<javafx.event.Event>() {
						@Override
						public void handle(javafx.event.Event event) {

							getActionsHandler().getSvgViewer().blinkingReset();
						}
					}, null);
		}

	}
}
