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.

SelectiveRenderer.java 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.ui;
  17. /**
  18. * Interface implemented by {@link HasComponents} implementors that wish to
  19. * dynamically be able to prevent given child components from reaching the
  20. * client side.
  21. *
  22. * @author Vaadin Ltd
  23. * @since 7.0
  24. *
  25. */
  26. public interface SelectiveRenderer extends HasComponents {
  27. /**
  28. * Checks if the child component should be rendered (sent to the client
  29. * side). This method allows hiding a child component from updates and
  30. * communication to and from the client. It is mostly useful for parents
  31. * which show only a limited number of their children at any given time and
  32. * want to allow updates only for the visible children (e.g. TabSheet has
  33. * one tab open at a time).
  34. * <p>
  35. * This method can only prevent updates from reaching the client, not force
  36. * child components to reach the client. If the child is set to visible,
  37. * returning false will prevent the child from being sent to the client. If
  38. * a child is set to invisible, this method has no effect.
  39. * </p>
  40. *
  41. * @param childComponent
  42. * The child component to check
  43. * @return true if the child component may be sent to the client, false
  44. * otherwise
  45. */
  46. public boolean isRendered(Component childComponent);
  47. }