jdk/src/share/classes/javax/swing/JSpinner.java
Print this page
*** 20,51 ****
*
* 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.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
--- 20,52 ----
*
* 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.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;
/**
* 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,122 ****
* 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
--- 109,118 ----
*** 124,133 ****
--- 120,131 ----
*
* @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,208 ****
--- 197,207 ----
*
* @return the string "SpinnerUI"
* @see JComponent#getUIClassID
* @see UIDefaults#getUI
*/
+ @BeanProperty(bound = false)
public String getUIClassID() {
return uiClassID;
}
*** 273,288 ****
* @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.
*/
public void setModel(SpinnerModel model) {
if (model == null) {
throw new IllegalArgumentException("null model");
}
if (!model.equals(this.model)) {
--- 272,284 ----
* @param model the new <code>SpinnerModel</code>
* @see #getModel
* @see #getEditor
* @see #setEditor
* @throws IllegalArgumentException if model is <code>null</code>
*/
+ @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,385 ****
--- 372,382 ----
* @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,445 ****
--- 433,443 ----
*
* @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,493 ****
--- 482,492 ----
* if one doesn't exist
* @see #getValue
* @see #getNextValue
* @see SpinnerModel#getPreviousValue
*/
+ @BeanProperty(bound = false)
public Object getPreviousValue() {
return getModel().getPreviousValue();
}
*** 502,517 ****
* @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
*/
public void setEditor(JComponent editor) {
if (editor == null) {
throw new IllegalArgumentException("null editor");
}
if (!editor.equals(this.editor)) {
--- 501,513 ----
* @param editor the new editor
* @see #getEditor
* @see #createEditor
* @see #getModel
* @throws IllegalArgumentException if editor is <code>null</code>
*/
+ @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,1436 ****
--- 1423,1433 ----
* 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;