jdk/src/share/classes/javax/swing/JSpinner.java

Print this page

        

@@ -20,32 +20,33 @@
  *
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package javax.swing;
 
 import java.awt.*;
 import java.awt.event.*;
 
 import javax.swing.event.*;
 import javax.swing.text.*;
 import javax.swing.plaf.SpinnerUI;
 
 import java.util.*;
-import java.beans.*;
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.text.*;
 import java.io.*;
 import java.text.spi.DateFormatProvider;
 import java.text.spi.NumberFormatProvider;
 
 import javax.accessibility.*;
+
 import sun.util.locale.provider.LocaleProviderAdapter;
 import sun.util.locale.provider.LocaleResources;
-import sun.util.locale.provider.LocaleServiceProviderPool;
-
 
 /**
  * A single line input field that lets the user select a
  * number or an object value from an ordered sequence. Spinners typically
  * provide a pair of tiny arrow buttons for stepping through the elements

@@ -108,15 +109,10 @@
  * the same version of Swing.  As of 1.4, support for long term storage
  * of all JavaBeans™
  * has been added to the <code>java.beans</code> package.
  * Please see {@link java.beans.XMLEncoder}.
  *
- * @beaninfo
- *   attribute: isContainer false
- * description: A single line input field that lets the user select a
- *     number or an object value from an ordered set.
- *
  * @see SpinnerModel
  * @see AbstractSpinnerModel
  * @see SpinnerListModel
  * @see SpinnerNumberModel
  * @see SpinnerDateModel

@@ -124,10 +120,12 @@
  *
  * @author Hans Muller
  * @author Lynn Monsanto (accessibility)
  * @since 1.4
  */
+@JavaBean(defaultProperty = "UI", description = "A single line input field that lets the user select a number or an object value from an ordered set.")
+@SwingContainer(false)
 @SuppressWarnings("serial") // Same-version serialization only
 public class JSpinner extends JComponent implements Accessible
 {
     /**
      * @see #getUIClassID

@@ -199,10 +197,11 @@
      *
      * @return the string "SpinnerUI"
      * @see JComponent#getUIClassID
      * @see UIDefaults#getUI
      */
+    @BeanProperty(bound = false)
     public String getUIClassID() {
         return uiClassID;
     }
 
 

@@ -273,16 +272,13 @@
      * @param model the new <code>SpinnerModel</code>
      * @see #getModel
      * @see #getEditor
      * @see #setEditor
      * @throws IllegalArgumentException if model is <code>null</code>
-     *
-     * @beaninfo
-     *        bound: true
-     *    attribute: visualUpdate true
-     *  description: Model that represents the value of this spinner.
      */
+    @BeanProperty(visualUpdate = true, description
+            = "Model that represents the value of this spinner.")
     public void setModel(SpinnerModel model) {
         if (model == null) {
             throw new IllegalArgumentException("null model");
         }
         if (!model.equals(this.model)) {

@@ -376,10 +372,11 @@
      * @return the next legal value or <code>null</code> if one doesn't exist
      * @see #getValue
      * @see #getPreviousValue
      * @see SpinnerModel#getNextValue
      */
+    @BeanProperty(bound = false)
     public Object getNextValue() {
         return getModel().getNextValue();
     }
 
 

@@ -436,10 +433,11 @@
      *
      * @return all of the <code>ChangeListener</code>s added or an empty
      *         array if no listeners have been added
      * @since 1.4
      */
+    @BeanProperty(bound = false)
     public ChangeListener[] getChangeListeners() {
         return listenerList.getListeners(ChangeListener.class);
     }
 
 

@@ -484,10 +482,11 @@
      *   if one doesn't exist
      * @see #getValue
      * @see #getNextValue
      * @see SpinnerModel#getPreviousValue
      */
+    @BeanProperty(bound = false)
     public Object getPreviousValue() {
         return getModel().getPreviousValue();
     }
 
 

@@ -502,16 +501,13 @@
      * @param editor the new editor
      * @see #getEditor
      * @see #createEditor
      * @see #getModel
      * @throws IllegalArgumentException if editor is <code>null</code>
-     *
-     * @beaninfo
-     *        bound: true
-     *    attribute: visualUpdate true
-     *  description: JComponent that displays the current value of the model
      */
+    @BeanProperty(visualUpdate = true, description
+            = "JComponent that displays the current value of the model")
     public void setEditor(JComponent editor) {
         if (editor == null) {
             throw new IllegalArgumentException("null editor");
         }
         if (!editor.equals(this.editor)) {

@@ -1427,10 +1423,11 @@
      * Gets the <code>AccessibleContext</code> for the <code>JSpinner</code>
      *
      * @return the <code>AccessibleContext</code> for the <code>JSpinner</code>
      * @since 1.5
      */
+    @BeanProperty(bound = false)
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJSpinner();
         }
         return accessibleContext;