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