package jp.hasc.hasctool.ui.commands;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.ui.IWorkbenchWindow;

/**
 * @author iwasaki
 */
public class HascPropertyTester extends PropertyTester {
	/** logger for this class */
	/*
	private final static org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
			.getLog(HascPropertyTester.class);
			*/
	
	@Override
	public boolean test(Object receiver, String property, Object[] args,
			Object expectedValue) {
		if (property.equals("StopBlockDiagramCommandEnabled")) {
			BlockDiagramExecutorManager em=BlockDiagramExecutorManager.getInstance(
					(IWorkbenchWindow)receiver);
			return em.isRunning();
		}else{
			return false;
		}
	}

}
