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.

HasChildMeasurementHintConnector.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright 2000-2016 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;
  17. import com.vaadin.client.ui.ManagedLayout;
  18. import com.vaadin.client.ui.layout.ElementResizeListener;
  19. /**
  20. * Connector with layout measuring hint. Used to improve granularity of control
  21. * over child component measurements.
  22. *
  23. * @since 7.6
  24. * @author Vaadin Ltd
  25. */
  26. public interface HasChildMeasurementHintConnector
  27. extends HasComponentsConnector {
  28. /**
  29. * Specifies how you would like child components measurements to be handled.
  30. * Since this is a hint, it can be ignored when deemed necessary.
  31. */
  32. public enum ChildMeasurementHint {
  33. /**
  34. * Always measure all child components (default).
  35. */
  36. MEASURE_ALWAYS,
  37. /**
  38. * Measure child component only if child component is a {@link Layout}
  39. * or implements either {@link ManagedLayout} or
  40. * {@link ElementResizeListener}.
  41. */
  42. MEASURE_IF_NEEDED,
  43. /**
  44. * Never measure child components. This can improve rendering speed of
  45. * components with lots of children (e.g. Table), but can cause some
  46. * child components to be rendered incorrectly (e.g. ComboBox).
  47. */
  48. MEASURE_NEVER
  49. }
  50. /**
  51. * Sets the child measurement hint for this component.
  52. *
  53. * @param hint
  54. * the value to set
  55. */
  56. void setChildMeasurementHint(ChildMeasurementHint hint);
  57. /**
  58. * Returns the current child measurement hint value.
  59. *
  60. * @return a ChildLayoutMeasureMode value
  61. */
  62. ChildMeasurementHint getChildMeasurementHint();
  63. }