/*
 * Created on Jan 3, 2004
 *
 */
package LumiSoft.UI.Controls;

import java.awt.*;
import javax.swing.*;

/**
 * 
 */
public class Utils 
{
	/** 
	 * Checks if specified component or some of it's child has focused.
	 * @param component Component which focus to check.
	 */
	public static boolean ContainsFocus(JComponent component)
	{		
		Component[] components = component.getComponents();
		for(int i=0;i<components.length;i++){
			if(components[i].hasFocus()){
				return true;
			}
			else if(Utils.ContainsFocus((JComponent)components[i])){
				return true;
			}
		}
		
		return false;
	}

}
