You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractComponentContainerConnector.java 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui;
  5. import java.util.LinkedList;
  6. import java.util.List;
  7. import com.vaadin.terminal.gwt.client.ComponentConnector;
  8. import com.vaadin.terminal.gwt.client.ComponentContainerConnector;
  9. import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent;
  10. import com.vaadin.terminal.gwt.client.Util;
  11. import com.vaadin.terminal.gwt.client.VConsole;
  12. public abstract class AbstractComponentContainerConnector extends
  13. AbstractComponentConnector implements ComponentContainerConnector {
  14. List<ComponentConnector> children;
  15. /**
  16. * Default constructor
  17. */
  18. public AbstractComponentContainerConnector() {
  19. }
  20. /*
  21. * (non-Javadoc)
  22. *
  23. * @see
  24. * com.vaadin.terminal.gwt.client.ComponentContainerConnector#getChildren()
  25. */
  26. public List<ComponentConnector> getChildren() {
  27. if (children == null) {
  28. return new LinkedList<ComponentConnector>();
  29. }
  30. return children;
  31. }
  32. /*
  33. * (non-Javadoc)
  34. *
  35. * @see
  36. * com.vaadin.terminal.gwt.client.ComponentContainerConnector#setChildren
  37. * (java.util.Collection)
  38. */
  39. public void setChildren(List<ComponentConnector> children) {
  40. this.children = children;
  41. }
  42. /*
  43. * (non-Javadoc)
  44. *
  45. * @see com.vaadin.terminal.gwt.client.ComponentContainerConnector#
  46. * connectorHierarchyChanged
  47. * (com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent)
  48. */
  49. public void connectorHierarchyChanged(ConnectorHierarchyChangedEvent event) {
  50. // TODO Remove debug info
  51. VConsole.log("Hierarchy changed for " + Util.getConnectorString(this));
  52. String oldChildren = "* Old children: ";
  53. for (ComponentConnector child : event.getOldChildren()) {
  54. oldChildren += Util.getConnectorString(child) + " ";
  55. }
  56. VConsole.log(oldChildren);
  57. String newChildren = "* New children: ";
  58. for (ComponentConnector child : getChildren()) {
  59. newChildren += Util.getConnectorString(child) + " ";
  60. }
  61. VConsole.log(newChildren);
  62. }
  63. }