jdk/src/java.desktop/share/classes/javax/swing/SwingContainer.java
author darcy
Fri, 03 Apr 2015 10:41:34 -0700
changeset 29894 3e16b51732f5
parent 25859 3317bb8137f4
child 35302 e4d2275861c3
permissions -rw-r--r--
8076520: Fix missing doclint warnings in javax.swing.{table, tree, undo, plaf.{metal, nimbus, synth}} Reviewed-by: alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25566
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     1
/*
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     4
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    10
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    15
 * accompanied this code).
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    16
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    20
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    23
 * questions.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    24
 */
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    25
package javax.swing;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    26
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    27
import java.lang.annotation.Retention;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    28
import java.lang.annotation.Target;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    29
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    30
import static java.lang.annotation.ElementType.TYPE;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    31
import static java.lang.annotation.RetentionPolicy.RUNTIME;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    32
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    33
/**
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    34
 * An annotation used to specify some swing-related information
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    35
 * for the automatically generated {@code BeanInfo} classes.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    36
 * This annotation is not used if the annotated class
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    37
 * has a corresponding user-defined {@code BeanInfo} class,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    38
 * which does not imply the automatic analysis.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    39
 * <p>
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    40
 * The {@code isContainer} {@link java.beans.BeanDescriptor#getValue
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    41
 * feature attribute} was introduced primarily for the Swing library.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    42
 * All Swing components extend the {@link java.awt.Container Container}
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    43
 * class by design, so the builder tool assumes that all Swing components
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    44
 * are containers.  The {@link java.beans.BeanInfo BeanInfo} classes
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    45
 * with the {@code isContainer} attribute allow to directly specify
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    46
 * whether a Swing component is a container or not.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    47
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    48
 * @since 1.9
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    49
 *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    50
 * @author Sergey A. Malenkov
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    51
 */
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    52
@Target({TYPE})
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    53
@Retention(RUNTIME)
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    54
public @interface SwingContainer {
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    55
    /**
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    56
     * The value that indicates whether the annotated class can be used
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    57
     * as a container for other Swing components or not.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    58
     *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    59
     * @return {@code true} if the annotated class is a Swing container;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    60
     *         {@code false} otherwise.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    61
     */
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    62
    boolean value() default true;
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    63
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    64
    /**
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    65
     * The name of the getter method in the annotated class,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    66
     * which returns the corresponding Swing container,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    67
     * if it is not recommended to add subcomponents
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    68
     * to the annotated class directly.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    69
     *
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    70
     * @return the name of the getter method in the annotated class,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    71
     *         which returns the corresponding Swing container,
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    72
     *         or an empty string if the method name is not set.
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    73
     */
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    74
    String delegate() default "";
ba387c302edd 4058433: RFE: tool for creating BeanInfo template
malenkov
parents:
diff changeset
    75
}