<commit_before>package org.pentaho.ui.xul.gwt;

import java.util.Iterator;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulContainer;
import org.pentaho.ui.xul.util.Align;

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

public abstract class AbstractGwtXulContainer extends AbstractGwtXulComponent implements XulContainer{

  protected Align alignment;
  protected boolean suppressLayout;
  
  public AbstractGwtXulContainer(String tagName){
    super(tagName);
  }
  
  public void addComponent(XulComponent component) {
    this.addChild(component);
    if(initialized == false){
      layout();
    }

  if (initialized) {
    resetContainer();
    layout();
  }

  }
  
  public void addComponentAt(XulComponent component, int idx) {
    this.addChildAt(component, idx);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

 
  public void removeComponent(XulComponent component) {
    this.removeChild(component);
    if (initialized) {
      resetContainer();
      layout();
    }<commit_msg>calling layout when childNodes changes<commit_after>package org.pentaho.ui.xul.gwt;

import java.util.Iterator;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulContainer;
import org.pentaho.ui.xul.XulDomException;
import org.pentaho.ui.xul.dom.Element;
import org.pentaho.ui.xul.util.Align;

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

public abstract class AbstractGwtXulContainer extends AbstractGwtXulComponent implements XulContainer{

  protected Align alignment;
  protected boolean suppressLayout;
  
  public AbstractGwtXulContainer(String tagName){
    super(tagName);
  }
  
  public void addComponent(XulComponent component) {
    this.addChild(component);
    if(initialized == false){
      layout();
    }
  
    if (initialized) {
      resetContainer();
      layout();
    }
  
  }

  
  
  @Override
  public void addChild(Element element) {
    super.addChild(element);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

  @Override
  public void addChildAt(Element element, int idx) {
    super.addChildAt(element, idx);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

  @Override
  public void removeChild(Element element) {
    super.removeChild(element);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

  @Override
  public void replaceChild(Element oldElement, Element newElement) {
    super.replaceChild(oldElement, newElement);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

  @Override
  public void replaceChild(XulComponent oldElement, XulComponent newElement)
      throws XulDomException {
    super.replaceChild(oldElement, newElement);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

  public void addComponentAt(XulComponent component, int idx) {
    this.addChildAt(component, idx);
    if (initialized) {
      resetContainer();
      layout();
    }
  }

 
  public void removeComponent(XulComponent component) {
    this.removeChild(component);
    if (initialized) {
      resetContainer();
      layout();
    }
{'fraction_non_alphanumeric': 0.10429252782193958, 'fraction_numerical': 0.0, 'mean_word_length': 3.3273727647867952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2371758', 'n_tokens_mistral': 960, 'n_tokens_neox': 955, 'n_words': 195}