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.

SpacerUpdater.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.client.widget.escalator;
  17. import com.vaadin.client.widget.escalator.RowContainer.BodyRowContainer;
  18. /**
  19. * An interface that handles the display of content for spacers.
  20. * <p>
  21. * The updater is responsible for making sure all elements are properly
  22. * constructed and cleaned up.
  23. *
  24. * @since 7.5.0
  25. * @author Vaadin Ltd
  26. * @see Spacer
  27. * @see BodyRowContainer
  28. */
  29. public interface SpacerUpdater {
  30. /** A spacer updater that does nothing. */
  31. public static final SpacerUpdater NULL = new SpacerUpdater() {
  32. @Override
  33. public void init(Spacer spacer) {
  34. // NOOP
  35. }
  36. @Override
  37. public void destroy(Spacer spacer) {
  38. // NOOP
  39. }
  40. };
  41. /**
  42. * Called whenever a spacer should be initialized with content.
  43. *
  44. * @param spacer
  45. * the spacer reference that should be initialized
  46. */
  47. void init(Spacer spacer);
  48. /**
  49. * Called whenever a spacer should be cleaned.
  50. * <p>
  51. * The structure to clean up is the same that has been constructed by
  52. * {@link #init(Spacer)}.
  53. *
  54. * @param spacer
  55. * the spacer reference that should be destroyed
  56. */
  57. void destroy(Spacer spacer);
  58. }