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