1. /*
  2. * @(#)Visibility.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.beans;
  8. /**
  9. * Under some circumstances a bean may be run on servers where a GUI
  10. * is not available. This interface can be used to query a bean to
  11. * determine whether it absolutely needs a gui, and to advise the
  12. * bean whether a GUI is available.
  13. * <p>
  14. * This interface is for expert developers, and is not needed
  15. * for normal simple beans. To avoid confusing end-users we
  16. * avoid using getXXX setXXX design patterns for these methods.
  17. */
  18. public interface Visibility {
  19. /**
  20. * Determines whether this bean needs a GUI.
  21. *
  22. * @return True if the bean absolutely needs a GUI available in
  23. * order to get its work done.
  24. */
  25. boolean needsGui();
  26. /**
  27. * This method instructs the bean that it should not use the Gui.
  28. */
  29. void dontUseGui();
  30. /**
  31. * This method instructs the bean that it is OK to use the Gui.
  32. */
  33. void okToUseGui();
  34. /**
  35. * Determines whether this bean is avoiding using a GUI.
  36. *
  37. * @return true if the bean is currently avoiding use of the Gui.
  38. * e.g. due to a call on dontUseGui().
  39. */
  40. boolean avoidingGui();
  41. }