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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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;
  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 an
  39. * {@link com.vaadin.client.ui.AbstractLayoutConnector AbstractLayoutConnector}
  40. * or implements either {@link ManagedLayout} or
  41. * {@link ElementResizeListener}.
  42. */
  43. MEASURE_IF_NEEDED,
  44. /**
  45. * Never measure child components. This can improve rendering speed of
  46. * components with lots of children (e.g. Table), but can cause some
  47. * child components to be rendered incorrectly (e.g. ComboBox).
  48. */
  49. MEASURE_NEVER
  50. }
  51. /**
  52. * Sets the child measurement hint for this component.
  53. *
  54. * @param hint
  55. * the value to set
  56. */
  57. void setChildMeasurementHint(ChildMeasurementHint hint);
  58. /**
  59. * Returns the current child measurement hint value.
  60. *
  61. * @return a ChildLayoutMeasureMode value
  62. */
  63. ChildMeasurementHint getChildMeasurementHint();
  64. }