< prev index next >

jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java

Print this page




  28 import java.lang.annotation.Target;
  29 
  30 import static java.lang.annotation.ElementType.TYPE;
  31 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  32 
  33 /**
  34  * An annotation used to specify some swing-related information
  35  * for the automatically generated {@code BeanInfo} classes.
  36  * This annotation is not used if the annotated class
  37  * has a corresponding user-defined {@code BeanInfo} class,
  38  * which does not imply the automatic analysis.
  39  * <p>
  40  * The {@code isContainer} {@link java.beans.BeanDescriptor#getValue
  41  * feature attribute} was introduced primarily for the Swing library.
  42  * All Swing components extend the {@link java.awt.Container Container}
  43  * class by design, so the builder tool assumes that all Swing components
  44  * are containers.  The {@link java.beans.BeanInfo BeanInfo} classes
  45  * with the {@code isContainer} attribute allow to directly specify
  46  * whether a Swing component is a container or not.
  47  *
  48  * @since 1.9
  49  *
  50  * @author Sergey A. Malenkov
  51  */
  52 @Target({TYPE})
  53 @Retention(RUNTIME)
  54 public @interface SwingContainer {
  55     /**
  56      * The value that indicates whether the annotated class can be used
  57      * as a container for other Swing components or not.
  58      *
  59      * @return {@code true} if the annotated class is a Swing container;
  60      *         {@code false} otherwise.
  61      */
  62     boolean value() default true;
  63 
  64     /**
  65      * The name of the getter method in the annotated class,
  66      * which returns the corresponding Swing container,
  67      * if it is not recommended to add subcomponents
  68      * to the annotated class directly.


  28 import java.lang.annotation.Target;
  29 
  30 import static java.lang.annotation.ElementType.TYPE;
  31 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  32 
  33 /**
  34  * An annotation used to specify some swing-related information
  35  * for the automatically generated {@code BeanInfo} classes.
  36  * This annotation is not used if the annotated class
  37  * has a corresponding user-defined {@code BeanInfo} class,
  38  * which does not imply the automatic analysis.
  39  * <p>
  40  * The {@code isContainer} {@link java.beans.BeanDescriptor#getValue
  41  * feature attribute} was introduced primarily for the Swing library.
  42  * All Swing components extend the {@link java.awt.Container Container}
  43  * class by design, so the builder tool assumes that all Swing components
  44  * are containers.  The {@link java.beans.BeanInfo BeanInfo} classes
  45  * with the {@code isContainer} attribute allow to directly specify
  46  * whether a Swing component is a container or not.
  47  *
  48  * @since 9
  49  *
  50  * @author Sergey A. Malenkov
  51  */
  52 @Target({TYPE})
  53 @Retention(RUNTIME)
  54 public @interface SwingContainer {
  55     /**
  56      * The value that indicates whether the annotated class can be used
  57      * as a container for other Swing components or not.
  58      *
  59      * @return {@code true} if the annotated class is a Swing container;
  60      *         {@code false} otherwise.
  61      */
  62     boolean value() default true;
  63 
  64     /**
  65      * The name of the getter method in the annotated class,
  66      * which returns the corresponding Swing container,
  67      * if it is not recommended to add subcomponents
  68      * to the annotated class directly.
< prev index next >