OSDN Git Service

Jumbo patch:
[pf3gnuchains/gcc-fork.git] / libjava / java / beans / Visibility.java
1 /* java.beans.Visibility
2    Copyright (C) 1998, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.beans;
29
30 /**
31  * Visibility is an interface a Bean may implement so that the environment
32  * can tell the Bean whether there is a GUI or not, and so that the Bean
33  * can tell the environment whether it needs one or can run without one.
34  * <P>
35  *
36  * Sun decided not to use standard Introspection patterns so that these
37  * methods did not get included when the Introspector made its sweep on
38  * the class.
39  *
40  * @author John Keiser
41  * @since JDK1.1
42  * @version 1.1.0, 29 Jul 1998
43  */
44
45 public interface Visibility {
46         /**
47          * Tells whether the Bean can run without a GUI or not.
48          * @return false if Bean can run without a GUI, else true.
49          */
50         public abstract boolean needsGui();
51
52         /**
53          * Tells whether Bean is trying not to use the GUI.
54          * If needsGui() is true, this method should always return false.
55          * @return true if definitely not using GUI, otherwise false.
56          */
57         public abstract boolean avoidingGui();
58
59         /**
60          * Tells the Bean not to use GUI methods.
61          * If needsGUI() is false, then after this method is called,
62          * avoidingGui() should return true.
63          */
64         public abstract void dontUseGui();
65
66         /**
67          * Tells the Bean it may use the GUI.
68          * The Bean is not required to use the GUI in this case, it is
69          * merely being <EM>permitted</EM> to use it.  If needsGui() is
70          * false, avoidingGui() may return true or false after this method
71          * is called.
72          */
73         public abstract void okToUseGui();
74 }