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.

Container.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client;
  5. import java.util.Set;
  6. import com.google.gwt.user.client.ui.Widget;
  7. public interface Container extends VPaintableWidget {
  8. /**
  9. * Replace child of this layout with another component.
  10. *
  11. * Each layout must be able to switch children. To to this, one must just
  12. * give references to a current and new child.
  13. *
  14. * @param oldComponent
  15. * Child to be replaced
  16. * @param newComponent
  17. * Child that replaces the oldComponent
  18. */
  19. void replaceChildComponent(Widget oldComponent, Widget newComponent);
  20. /**
  21. * Is a given component child of this layout.
  22. *
  23. * @param component
  24. * Component to test.
  25. * @return true iff component is a child of this layout.
  26. */
  27. boolean hasChildComponent(Widget component);
  28. /**
  29. * Update child components caption, description and error message.
  30. *
  31. * <p>
  32. * Each component is responsible for maintaining its caption, description
  33. * and error message. In most cases components doesn't want to do that and
  34. * those elements reside outside of the component. Because of this layouts
  35. * must provide service for it's childen to show those elements for them.
  36. * </p>
  37. *
  38. * @param component
  39. * Child component for which service is requested.
  40. * @param uidl
  41. * UIDL of the child component.
  42. */
  43. void updateCaption(VPaintableWidget component, UIDL uidl);
  44. /**
  45. * Called when a child components size has been updated in the rendering
  46. * phase.
  47. *
  48. * @param children
  49. * Set of child widgets whose size have changed
  50. * @return true if the size of the Container remains the same, false if the
  51. * event need to be propagated to the Containers parent
  52. */
  53. boolean requestLayout(Set<Widget> children);
  54. /**
  55. * Returns the size currently allocated for the child component.
  56. *
  57. * @param child
  58. * @return
  59. */
  60. RenderSpace getAllocatedSpace(Widget child);
  61. }