package j3deditor.bin.components;

import java.awt.Component;
import java.awt.Container;


/**
 * Contains methods for manipulating with components.
 * 
 * @author Risto Seene
 */
public class ComponentUtils{

	/**
	 * Removes recursivly all components from the given <code>Container</code>.
	 * 
	 * @param c
	 * 	container which children will be removed
	 */
	public static void removeChildren(Container c){
	          Component[] comps = c.getComponents();
	          for(int i = 0; i < comps.length; i++){
	                    if(comps[i] instanceof Container){
	                              removeChildren((Container)comps[i]);
	                    }
	          }
	          c.removeAll();
	}
}
