--- old/src/java.desktop/share/classes/javax/swing/JTabbedPane.java 2015-09-19 03:04:39.145043500 +0300 +++ new/src/java.desktop/share/classes/javax/swing/JTabbedPane.java 2015-09-19 03:04:38.941860700 +0300 @@ -22,16 +22,18 @@ * 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 java.beans.JavaBean; +import java.beans.BeanProperty; import java.beans.Transient; import java.util.*; import javax.swing.event.*; import javax.swing.plaf.*; import javax.accessibility.*; + import sun.swing.SwingUtilities2; import java.io.Serializable; @@ -95,11 +97,6 @@ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * - * @beaninfo - * attribute: isContainer true - * description: A component which provides a tab folder metaphor for - * displaying one component from a set of components. - * * @author Dave Moore * @author Philip Milne * @author Amy Fowler @@ -107,6 +104,8 @@ * @see SingleSelectionModel * @since 1.2 */ +@JavaBean(defaultProperty = "UI", description = "A component which provides a tab folder metaphor for displaying one component from a set of components.") +@SwingContainer @SuppressWarnings("serial") // Same-version serialization only public class JTabbedPane extends JComponent implements Serializable, Accessible, SwingConstants { @@ -223,12 +222,9 @@ * * @param ui the new UI object * @see UIDefaults#getUI - * @beaninfo - * bound: true - * hidden: true - * attribute: visualUpdate true - * description: The UI object that implements the tabbedpane's LookAndFeel */ + @BeanProperty(hidden = true, visualUpdate = true, description + = "The UI object that implements the tabbedpane's LookAndFeel") public void setUI(TabbedPaneUI ui) { super.setUI(ui); // disabled icons are generated by LF so they should be unset here @@ -258,6 +254,7 @@ * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false) public String getUIClassID() { return uiClassID; } @@ -315,7 +312,8 @@ * array if no listeners have been added * @since 1.4 */ - public ChangeListener[] getChangeListeners() { + @BeanProperty(bound = false) + public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class); } @@ -437,10 +435,9 @@ * * @param model the model to be used * @see #getModel - * @beaninfo - * bound: true - * description: The tabbedpane's SingleSelectionModel. */ + @BeanProperty(description + = "The tabbedpane's SingleSelectionModel.") public void setModel(SingleSelectionModel model) { SingleSelectionModel oldModel = getModel(); @@ -483,18 +480,13 @@ * @param tabPlacement the placement for the tabs relative to the content * @exception IllegalArgumentException if tab placement value isn't one * of the above valid values - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * enum: TOP JTabbedPane.TOP - * LEFT JTabbedPane.LEFT - * BOTTOM JTabbedPane.BOTTOM - * RIGHT JTabbedPane.RIGHT - * description: The tabbedpane's tab placement. - * */ + @BeanProperty(preferred = true, visualUpdate = true, enumerationValues = { + "JTabbedPane.TOP", + "JTabbedPane.LEFT", + "JTabbedPane.BOTTOM", + "JTabbedPane.RIGHT"}, description + = "The tabbedpane's tab placement.") public void setTabPlacement(int tabPlacement) { checkTabPlacement(tabPlacement); if (this.tabPlacement != tabPlacement) { @@ -546,16 +538,11 @@ * of the above valid values * @see #getTabLayoutPolicy * @since 1.4 - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * enum: WRAP_TAB_LAYOUT JTabbedPane.WRAP_TAB_LAYOUT - * SCROLL_TAB_LAYOUT JTabbedPane.SCROLL_TAB_LAYOUT - * description: The tabbedpane's policy for laying out the tabs - * */ + @BeanProperty(preferred = true, visualUpdate = true, enumerationValues = { + "JTabbedPane.WRAP_TAB_LAYOUT", + "JTabbedPane.SCROLL_TAB_LAYOUT"}, description + = "The tabbedpane's policy for laying out the tabs") public void setTabLayoutPolicy(int tabLayoutPolicy) { checkTabLayoutPolicy(tabLayoutPolicy); if (this.tabLayoutPolicy != tabLayoutPolicy) { @@ -600,10 +587,9 @@ * * @see #getSelectedIndex * @see SingleSelectionModel#setSelectedIndex - * @beaninfo - * preferred: true - * description: The tabbedpane's selected tab index. */ + @BeanProperty(bound = false, preferred = true, description + = "The tabbedpane's selected tab index.") public void setSelectedIndex(int index) { if (index != -1) { checkIndex(index); @@ -686,10 +672,9 @@ * @exception IllegalArgumentException if component not found in tabbed * pane * @see #getSelectedComponent - * @beaninfo - * preferred: true - * description: The tabbedpane's selected component. */ + @BeanProperty(bound = false, preferred = true, description + = "The tabbedpane's selected component.") public void setSelectedComponent(Component c) { int index = indexOfComponent(c); if (index != -1) { @@ -1096,6 +1081,7 @@ * * @return an integer specifying the number of tabbed pages */ + @BeanProperty(bound = false) public int getTabCount() { return pages.size(); } @@ -1111,6 +1097,7 @@ * is LEFT or RIGHT, * or 0 if there is no UI set on this tabbedpane */ + @BeanProperty(bound = false) public int getTabRunCount() { if (ui != null) { return ((TabbedPaneUI)ui).getTabRunCount(this); @@ -1329,11 +1316,9 @@ * * @see #getTitleAt * @see #setTabComponentAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The title at the specified tab index. */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The title at the specified tab index.") public void setTitleAt(int index, String title) { Page page = pages.get(index); String oldTitle =page.title; @@ -1373,11 +1358,9 @@ * @see #getIconAt * @see #getDisabledIconAt * @see #setTabComponentAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The icon at the specified tab index. */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The icon at the specified tab index.") public void setIconAt(int index, Icon icon) { Page page = pages.get(index); Icon oldIcon = page.icon; @@ -1414,11 +1397,9 @@ * {@code (index < 0 || index >= tab count)} * * @see #getDisabledIconAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The disabled icon at the specified tab index. */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The disabled icon at the specified tab index.") public void setDisabledIconAt(int index, Icon disabledIcon) { Icon oldIcon = pages.get(index).disabledIcon; pages.get(index).disabledIcon = disabledIcon; @@ -1439,11 +1420,10 @@ * {@code (index < 0 || index >= tab count)} * * @see #getToolTipTextAt - * @beaninfo - * preferred: true - * description: The tooltip text at the specified tab index. * @since 1.3 */ + @BeanProperty(preferred = true, description + = "The tooltip text at the specified tab index.") public void setToolTipTextAt(int index, String toolTipText) { String oldToolTipText = pages.get(index).tip; pages.get(index).tip = toolTipText; @@ -1475,11 +1455,9 @@ * {@code (index < 0 || index >= tab count)} * * @see #getBackgroundAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The background color at the specified tab index. */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The background color at the specified tab index.") public void setBackgroundAt(int index, Color background) { Color oldBg = pages.get(index).background; pages.get(index).setBackground(background); @@ -1508,11 +1486,9 @@ * {@code (index < 0 || index >= tab count)} * * @see #getForegroundAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The foreground color at the specified tab index. */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The foreground color at the specified tab index.") public void setForegroundAt(int index, Color foreground) { Color oldFg = pages.get(index).foreground; pages.get(index).setForeground(foreground); @@ -1555,10 +1531,9 @@ * {@code (index < 0 || index >= tab count)} * * @see #getComponentAt - * @beaninfo - * attribute: visualUpdate true - * description: The component at the specified tab index. */ + @BeanProperty(visualUpdate = true, description + = "The component at the specified tab index.") @SuppressWarnings("deprecation") public void setComponentAt(int index, Component component) { Page page = pages.get(index); @@ -1635,13 +1610,9 @@ * title , or < -1 * @see #setMnemonicAt(int,int) * @see #getDisplayedMnemonicIndexAt(int) - * - * @beaninfo - * bound: true - * attribute: visualUpdate true - * description: the index into the String to draw the keyboard character - * mnemonic at */ + @BeanProperty(visualUpdate = true, description + = "the index into the String to draw the keyboard character mnemonic at") public void setDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex) { checkIndex(tabIndex); @@ -1675,13 +1646,9 @@ * of range ({@code tabIndex < 0 || tabIndex >= tab count}) * @see #getMnemonicAt(int) * @see #setDisplayedMnemonicIndexAt(int,int) - * - * @beaninfo - * bound: true - * attribute: visualUpdate true - * description: The keyboard mnenmonic, as a KeyEvent VK constant, - * for the specified tab */ + @BeanProperty(visualUpdate = true, description + = "The keyboard mnenmonic, as a KeyEvent VK constant, for the specified tab") public void setMnemonicAt(int tabIndex, int mnemonic) { checkIndex(tabIndex); @@ -1896,6 +1863,7 @@ * @return an AccessibleJTabbedPane that serves as the * AccessibleContext of this JTabbedPane */ + @BeanProperty(bound = false) public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJTabbedPane(); @@ -2397,12 +2365,10 @@ * added to this JTabbedPane * * @see #getTabComponentAt - * @beaninfo - * preferred: true - * attribute: visualUpdate true - * description: The tab component at the specified tab index. * @since 1.6 */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The tab component at the specified tab index.") public void setTabComponentAt(int index, Component component) { if (component != null && indexOfComponent(component) != -1) { throw new IllegalArgumentException("Component is already added to this JTabbedPane");