home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / beans / Visibility.java < prev   
Encoding:
Java Source  |  1999-05-28  |  1.6 KB  |  57 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)Visibility.java    1.9 98/09/21
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.beans;
  16.  
  17. /**
  18.  * Under some circumstances a bean may be run on servers where a GUI
  19.  * is not available.  This interface can be used to query a bean to
  20.  * determine whether it absolutely needs a gui, and to advise the
  21.  * bean whether a GUI is available.
  22.  * <p>
  23.  * This interface is for expert developers, and is not needed
  24.  * for normal simple beans.  To avoid confusing end-users we
  25.  * avoid using getXXX setXXX design patterns for these methods.
  26.  */
  27.  
  28. public interface Visibility {
  29.  
  30.     /**
  31.      * Determines whether this bean needs a GUI.
  32.      *
  33.      * @return True if the bean absolutely needs a GUI available in
  34.      *        order to get its work done.
  35.      */
  36.     boolean needsGui();
  37.  
  38.     /**
  39.      * This method instructs the bean that it should not use the Gui.
  40.      */
  41.     void dontUseGui();
  42.  
  43.     /**
  44.      * This method instructs the bean that it is OK to use the Gui.
  45.      */
  46.     void okToUseGui();
  47.  
  48.     /**
  49.      * Determines whether this bean is avoiding using a GUI.
  50.      *
  51.      * @return true if the bean is currently avoiding use of the Gui.
  52.      *   e.g. due to a call on dontUseGui().
  53.      */
  54.     boolean avoidingGui();
  55.  
  56. }
  57.