home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 July & August / Pcwk78a98.iso / Internet / Javadraw / DATA.Z / Visibility.java < prev    next >
Text File  |  1997-08-30  |  2KB  |  61 lines

  1. /*
  2.  * @(#)Visibility.java    1.5 96/12/06  
  3.  * 
  4.  * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion bdk_beta
  20.  * 
  21.  */
  22.  
  23. package java.beans;
  24.  
  25. /**
  26.  * Under some circumstances a bean may be run on servers where a GUI
  27.  * is not available.  This interface can be used to query a bean to
  28.  * determine whether it absolutely needs a gui, and to advise the
  29.  * bean whether a GUI is available.
  30.  * <p>
  31.  * This interface is for expert developers, and is not needed
  32.  * for normal simple beans.  To avoid confusing end-users we
  33.  * avoid using getXXX setXXX design patterns for these methods.
  34.  */
  35.  
  36. public interface Visibility {
  37.  
  38.     /**
  39.      * @return True if the bean absolutely needs a GUI available in
  40.      *        order to get its work done.
  41.      */
  42.     boolean needsGui();
  43.  
  44.     /**
  45.      * This method instructs the bean that it should not use the Gui.
  46.      */
  47.     void dontUseGui();
  48.  
  49.     /**
  50.      * This method instructs the bean that it is OK to use the Gui.
  51.      */
  52.     void okToUseGui();
  53.  
  54.     /**
  55.      * @return true if the bean is currently avoiding use of the Gui.
  56.      *   e.g. due to a call on dontUseGui().
  57.      */
  58.     boolean avoidingGui();
  59.  
  60. }
  61.