--- old/jdk/src/share/classes/javax/swing/JComboBox.java 2014-08-11 11:49:42.761667100 +0400 +++ new/jdk/src/share/classes/javax/swing/JComboBox.java 2014-08-11 11:49:42.436648600 +0400 @@ -24,6 +24,8 @@ */ package javax.swing; +import java.beans.JavaBean; +import java.beans.BeanProperty; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.Transient; @@ -71,14 +73,12 @@ * * @param the type of the elements of this combo box * - * @beaninfo - * attribute: isContainer false - * description: A combination of a text field and a drop-down list. - * * @author Arnaud Weber * @author Mark Davidson * @since 1.2 */ +@JavaBean(defaultProperty = "UI", description = "A combination of a text field and a drop-down list.") +@SwingContainer(false) @SuppressWarnings("serial") // Same-version serialization only public class JComboBox extends JComponent implements ItemSelectable,ListDataListener,ActionListener, Accessible { @@ -255,13 +255,9 @@ * * @param ui the ComboBoxUI L&F object * @see UIDefaults#getUI - * - * @beaninfo - * bound: true - * hidden: true - * attribute: visualUpdate true - * description: The UI object that implements the Component's LookAndFeel. */ + @BeanProperty(hidden = true, visualUpdate = true, description + = "The UI object that implements the Component's LookAndFeel.") public void setUI(ComboBoxUI ui) { super.setUI(ui); } @@ -288,6 +284,7 @@ * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false) public String getUIClassID() { return uiClassID; } @@ -308,11 +305,9 @@ * * @param aModel the ComboBoxModel that provides the * displayed list of items - * - * @beaninfo - * bound: true - * description: Model that the combo box uses to get data to display. */ + @BeanProperty(description + = "Model that the combo box uses to get data to display.") public void setModel(ComboBoxModel aModel) { ComboBoxModel oldModel = dataModel; if (oldModel != null) { @@ -363,12 +358,9 @@ * This method fires a property changed event. * * @param aFlag if true, lightweight popups are desired - * - * @beaninfo - * bound: true - * expert: true - * description: Set to false to require heavyweight popups. */ + @BeanProperty(expert = true, description + = "Set to false to require heavyweight popups.") public void setLightWeightPopupEnabled(boolean aFlag) { boolean oldFlag = lightWeightPopupEnabled; lightWeightPopupEnabled = aFlag; @@ -398,12 +390,9 @@ * * @param aFlag a boolean value, where true indicates that the * field is editable - * - * @beaninfo - * bound: true - * preferred: true - * description: If true, the user can type a new value in the combo box. */ + @BeanProperty(preferred = true, description + = "If true, the user can type a new value in the combo box.") public void setEditable(boolean aFlag) { boolean oldFlag = isEditable; isEditable = aFlag; @@ -427,11 +416,9 @@ * * @param count an integer specifying the maximum number of items to * display in the list before using a scrollbar - * @beaninfo - * bound: true - * preferred: true - * description: The maximum number of rows the popup should have */ + @BeanProperty(preferred = true, description + = "The maximum number of rows the popup should have") public void setMaximumRowCount(int count) { int oldCount = maximumRowCount; maximumRowCount = count; @@ -465,11 +452,9 @@ * @param aRenderer the ListCellRenderer that * displays the selected item * @see #setEditor - * @beaninfo - * bound: true - * expert: true - * description: The renderer that paints the item selected in the list. */ + @BeanProperty(expert = true, description + = "The renderer that paints the item selected in the list.") public void setRenderer(ListCellRenderer aRenderer) { ListCellRenderer oldRenderer = renderer; renderer = aRenderer; @@ -497,11 +482,9 @@ * @param anEditor the ComboBoxEditor that * displays the selected item * @see #setRenderer - * @beaninfo - * bound: true - * expert: true - * description: The editor that combo box uses to edit the current value */ + @BeanProperty(expert = true, description + = "The editor that combo box uses to edit the current value") public void setEditor(ComboBoxEditor anEditor) { ComboBoxEditor oldEditor = editor; @@ -553,10 +536,9 @@ * * @param anObject the list object to select; use null to clear the selection - * @beaninfo - * preferred: true - * description: Sets the selected item in the JComboBox. */ + @BeanProperty(bound = false, preferred = true, description + = "Sets the selected item in the JComboBox.") public void setSelectedItem(Object anObject) { Object oldSelection = selectedItemReminder; Object objectToSelect = anObject; @@ -616,10 +598,9 @@ * where 0 specifies the first item in the list and -1 indicates no selection * @exception IllegalArgumentException if anIndex < -1 or * anIndex is greater than or equal to size - * @beaninfo - * preferred: true - * description: The item at index is selected. */ + @BeanProperty(bound = false, preferred = true, description + = "The item at index is selected.") public void setSelectedIndex(int anIndex) { int size = dataModel.getSize(); @@ -687,11 +668,9 @@ * @param prototypeDisplayValue the prototype display value * @see #getPrototypeDisplayValue * @since 1.4 - * @beaninfo - * bound: true - * attribute: visualUpdate true - * description: The display prototype value, used to compute display width and height. */ + @BeanProperty(visualUpdate = true, description + = "The display prototype value, used to compute display width and height.") public void setPrototypeDisplayValue(E prototypeDisplayValue) { Object oldValue = this.prototypeDisplayValue; this.prototypeDisplayValue = prototypeDisplayValue; @@ -867,6 +846,7 @@ * array if no listeners have been added * @since 1.4 */ + @BeanProperty(bound = false) public ItemListener[] getItemListeners() { return listenerList.getListeners(ItemListener.class); } @@ -905,6 +885,7 @@ * array if no listeners have been added * @since 1.4 */ + @BeanProperty(bound = false) public ActionListener[] getActionListeners() { return listenerList.getListeners(ActionListener.class); } @@ -944,6 +925,7 @@ * array if no listeners have been added * @since 1.4 */ + @BeanProperty(bound = false) public PopupMenuListener[] getPopupMenuListeners() { return listenerList.getListeners(PopupMenuListener.class); } @@ -1072,11 +1054,9 @@ * @see #configurePropertiesFromAction * @see #createActionPropertyChangeListener * @see #actionPropertyChanged - * @beaninfo - * bound: true - * attribute: visualUpdate true - * description: the Action instance connected with this ActionEvent source */ + @BeanProperty(visualUpdate = true, description + = "the Action instance connected with this ActionEvent source") public void setAction(Action a) { Action oldValue = getAction(); if (action==null || !action.equals(a)) { @@ -1303,6 +1283,7 @@ * @return an array of Objects containing one * element -- the selected item */ + @BeanProperty(bound = false) public Object[] getSelectedObjects() { Object selectedObject = getSelectedItem(); if ( selectedObject == null ) @@ -1395,11 +1376,9 @@ * * @param b a boolean value, where true enables the component and * false disables it - * @beaninfo - * bound: true - * preferred: true - * description: Whether the combo box is enabled. */ + @BeanProperty(preferred = true, description + = "The enabled state of the component.") public void setEnabled(boolean b) { super.setEnabled(b); firePropertyChange( "enabled", !isEnabled(), isEnabled() ); @@ -1459,10 +1438,9 @@ * character becomes the selected item. * * @param aManager a key selection manager - * @beaninfo - * expert: true - * description: The objects that changes the selection when a key is pressed. */ + @BeanProperty(bound = false, expert = true, description + = "The objects that changes the selection when a key is pressed.") public void setKeySelectionManager(KeySelectionManager aManager) { keySelectionManager = aManager; } @@ -1482,6 +1460,7 @@ * * @return an integer equal to the number of items in the list */ + @BeanProperty(bound = false) public int getItemCount() { return dataModel.getSize(); } @@ -1630,6 +1609,7 @@ * @return an AccessibleJComboBox that serves as the * AccessibleContext of this JComboBox */ + @BeanProperty(bound = false) public AccessibleContext getAccessibleContext() { if ( accessibleContext == null ) { accessibleContext = new AccessibleJComboBox(); @@ -2132,11 +2112,9 @@ * * @see #getAccessibleName * @see #addPropertyChangeListener - * - * @beaninfo - * preferred: true - * description: Sets the accessible name for the component. */ + @BeanProperty(preferred = true, description + = "Sets the accessible name for the component.") public void setAccessibleName(String s) { ac.setAccessibleName(s); } @@ -2166,11 +2144,9 @@ * * @see #setAccessibleName * @see #addPropertyChangeListener - * - * @beaninfo - * preferred: true - * description: Sets the accessible description for the component. */ + @BeanProperty(preferred = true, description + = "Sets the accessible description for the component.") public void setAccessibleDescription(String s) { ac.setAccessibleDescription(s); }