<commit_before>package com.itmill.toolkit.terminal.gwt.client;

import com.google.gwt.user.client.ui.Widget;

public interface Layout extends Paintable {

	void replaceChildComponent(Widget oldComponent, Widget newComponent);

	boolean hasChildComponent(Widget component);

}<commit_msg>Documented Layout interface<commit_after>package com.itmill.toolkit.terminal.gwt.client;

import com.google.gwt.user.client.ui.Widget;

public interface Layout extends Paintable {

	/**
	 * Replace child of this layout with another component.
	 * 
	 * Each layout must be able to switch children. To to this, one must just
	 * give references to a current and new child. Note that the Layout is not
	 * responsible for registering paintable into client.
	 * 
	 * @param oldComponent
	 *            Child to be replaced
	 * @param newComponent
	 *            Child that replaces the oldComponent
	 */
	void replaceChildComponent(Widget oldComponent, Widget newComponent);

	/**
	 * Is a given component child of this layout.
	 * 
	 * @param component
	 *            Component to test.
	 * @return true iff component is a child of this layout.
	 */
	boolean hasChildComponent(Widget component);

	/**
	 * Update child components caption, description and error message.
	 * 
	 * <p>
	 * Each component is responsible for maintaining its caption, description
	 * and error message. In most cases components doesn't want to do that and
	 * those elements reside outside of the component. Because of this layouts
	 * should provide service for it's childen to show those elements for them.
	 * </p>
	 * 
	 * @param component
	 *            Child component that requests the service.
	 * @param uidl
	 *            UIDL of the child component.
	 * @return true iff this layout updated caption succesfully.
	 */
	boolean updateCaption(Widget component, UIDL uidl);
}
{'fraction_non_alphanumeric': 0.06991869918699187, 'fraction_numerical': 0.0, 'mean_word_length': 3.395238095238095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6956624', 'n_tokens_mistral': 509, 'n_tokens_neox': 450, 'n_words': 197}