--- old/jdk/src/share/classes/javax/swing/JTabbedPane.java 2014-08-11 11:50:58.949024800 +0400
+++ new/jdk/src/share/classes/javax/swing/JTabbedPane.java 2014-08-11 11:50:58.512999900 +0400
@@ -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);
}
@@ -436,10 +434,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();
@@ -482,18 +479,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) {
@@ -545,16 +537,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) {
@@ -599,10 +586,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);
@@ -685,10 +671,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) {
@@ -1094,6 +1079,7 @@
*
* @return an integer specifying the number of tabbed pages
*/
+ @BeanProperty(bound = false)
public int getTabCount() {
return pages.size();
}
@@ -1109,6 +1095,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);
@@ -1327,11 +1314,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;
@@ -1371,11 +1356,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;
@@ -1412,11 +1395,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;
@@ -1437,11 +1418,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;
@@ -1473,11 +1453,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);
@@ -1506,11 +1484,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);
@@ -1553,10 +1529,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.")
public void setComponentAt(int index, Component component) {
Page page = pages.get(index);
if (component != page.component) {
@@ -1632,13 +1607,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);
@@ -1672,13 +1643,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);
@@ -1893,6 +1860,7 @@
* @return an AccessibleJTabbedPane that serves as the
* AccessibleContext of this JTabbedPane
*/
+ @BeanProperty(bound = false)
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new AccessibleJTabbedPane();
@@ -2392,12 +2360,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");