jdk/src/share/classes/javax/swing/AbstractButton.java
Print this page
*** 24,50 ****
*/
package javax.swing;
import java.awt.*;
import java.awt.event.*;
- import java.awt.image.*;
import java.text.*;
import java.awt.geom.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.Transient;
import java.util.Enumeration;
- import java.util.Vector;
import java.io.Serializable;
import javax.swing.event.*;
- import javax.swing.border.*;
import javax.swing.plaf.*;
import javax.accessibility.*;
import javax.swing.text.*;
- import javax.swing.text.html.*;
- import javax.swing.plaf.basic.*;
- import java.util.*;
/**
* Defines common behaviors for buttons and menu items.
* <p>
* Buttons can be configured, and to some degree controlled, by
--- 24,46 ----
*/
package javax.swing;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
import java.awt.geom.*;
+ import java.beans.JavaBean;
+ import java.beans.BeanProperty;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.Transient;
import java.util.Enumeration;
import java.io.Serializable;
import javax.swing.event.*;
import javax.swing.plaf.*;
import javax.accessibility.*;
import javax.swing.text.*;
/**
* Defines common behaviors for buttons and menu items.
* <p>
* Buttons can be configured, and to some degree controlled, by
*** 71,80 ****
--- 67,77 ----
* Please see {@link java.beans.XMLEncoder}.
*
* @author Jeff Dinkins
* @since 1.2
*/
+ @JavaBean(defaultProperty = "UI")
@SuppressWarnings("serial") // Same-version serialization only
public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants {
// *********************************
// ******* Button properties *******
*** 249,264 ****
* that of the <code>Action</code>; the default is
* <code>false</code>
* @see <a href="Action.html#buttonActions">Swing Components Supporting
* <code>Action</code></a>
* @since 1.6
- * @beaninfo
- * bound: true
- * expert: true
- * description: Whether the text of the button should come from
- * the <code>Action</code>.
*/
public void setHideActionText(boolean hideActionText) {
if (hideActionText != this.hideActionText) {
this.hideActionText = hideActionText;
if (getAction() != null) {
setTextFromAction(getAction(), false);
--- 246,258 ----
* that of the <code>Action</code>; the default is
* <code>false</code>
* @see <a href="Action.html#buttonActions">Swing Components Supporting
* <code>Action</code></a>
* @since 1.6
*/
+ @BeanProperty(expert = true, description
+ = "Whether the text of the button should come from the <code>Action</code>.")
public void setHideActionText(boolean hideActionText) {
if (hideActionText != this.hideActionText) {
this.hideActionText = hideActionText;
if (getAction() != null) {
setTextFromAction(getAction(), false);
*** 294,309 ****
/**
* Sets the button's text.
* @param text the string used to set the text
* @see #getText
- * @beaninfo
- * bound: true
- * preferred: true
- * attribute: visualUpdate true
- * description: The button's text.
*/
public void setText(String text) {
String oldValue = this.text;
this.text = text;
firePropertyChange(TEXT_CHANGED_PROPERTY, oldValue, text);
updateDisplayedMnemonicIndex(text, getMnemonic());
--- 288,300 ----
/**
* Sets the button's text.
* @param text the string used to set the text
* @see #getText
*/
+ @BeanProperty(preferred = true, visualUpdate = true, description
+ = "The button's text.")
public void setText(String text) {
String oldValue = this.text;
this.text = text;
firePropertyChange(TEXT_CHANGED_PROPERTY, oldValue, text);
updateDisplayedMnemonicIndex(text, getMnemonic());
*** 388,403 ****
* it is that <code>Border</code> object's responsibility to create the
* appropriate margin space (else this property will
* effectively be ignored).
*
* @param m the space between the border and the label
- *
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The space between the button's border and the label.
*/
public void setMargin(Insets m) {
// Cache the old margin if it comes from the UI
if(m instanceof UIResource) {
defaultMargin = m;
} else if(margin instanceof UIResource) {
--- 379,391 ----
* it is that <code>Border</code> object's responsibility to create the
* appropriate margin space (else this property will
* effectively be ignored).
*
* @param m the space between the border and the label
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The space between the button's border and the label.")
public void setMargin(Insets m) {
// Cache the old margin if it comes from the UI
if(m instanceof UIResource) {
defaultMargin = m;
} else if(margin instanceof UIResource) {
*** 446,460 ****
* there is no explicitly set pressed icon.
*
* @param defaultIcon the icon used as the default image
* @see #getIcon
* @see #setPressedIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The button's default icon
*/
public void setIcon(Icon defaultIcon) {
Icon oldValue = this.defaultIcon;
this.defaultIcon = defaultIcon;
/* If the default icon has really changed and we had
--- 434,446 ----
* there is no explicitly set pressed icon.
*
* @param defaultIcon the icon used as the default image
* @see #getIcon
* @see #setPressedIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The button's default icon")
public void setIcon(Icon defaultIcon) {
Icon oldValue = this.defaultIcon;
this.defaultIcon = defaultIcon;
/* If the default icon has really changed and we had
*** 493,507 ****
/**
* Sets the pressed icon for the button.
* @param pressedIcon the icon used as the "pressed" image
* @see #getPressedIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The pressed icon for the button.
*/
public void setPressedIcon(Icon pressedIcon) {
Icon oldValue = this.pressedIcon;
this.pressedIcon = pressedIcon;
firePropertyChange(PRESSED_ICON_CHANGED_PROPERTY, oldValue, pressedIcon);
if (accessibleContext != null) {
--- 479,491 ----
/**
* Sets the pressed icon for the button.
* @param pressedIcon the icon used as the "pressed" image
* @see #getPressedIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The pressed icon for the button.")
public void setPressedIcon(Icon pressedIcon) {
Icon oldValue = this.pressedIcon;
this.pressedIcon = pressedIcon;
firePropertyChange(PRESSED_ICON_CHANGED_PROPERTY, oldValue, pressedIcon);
if (accessibleContext != null) {
*** 527,541 ****
/**
* Sets the selected icon for the button.
* @param selectedIcon the icon used as the "selected" image
* @see #getSelectedIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The selected icon for the button.
*/
public void setSelectedIcon(Icon selectedIcon) {
Icon oldValue = this.selectedIcon;
this.selectedIcon = selectedIcon;
/* If the default selected icon has really changed and we had
--- 511,523 ----
/**
* Sets the selected icon for the button.
* @param selectedIcon the icon used as the "selected" image
* @see #getSelectedIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The selected icon for the button.")
public void setSelectedIcon(Icon selectedIcon) {
Icon oldValue = this.selectedIcon;
this.selectedIcon = selectedIcon;
/* If the default selected icon has really changed and we had
*** 573,587 ****
/**
* Sets the rollover icon for the button.
* @param rolloverIcon the icon used as the "rollover" image
* @see #getRolloverIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The rollover icon for the button.
*/
public void setRolloverIcon(Icon rolloverIcon) {
Icon oldValue = this.rolloverIcon;
this.rolloverIcon = rolloverIcon;
firePropertyChange(ROLLOVER_ICON_CHANGED_PROPERTY, oldValue, rolloverIcon);
if (accessibleContext != null) {
--- 555,567 ----
/**
* Sets the rollover icon for the button.
* @param rolloverIcon the icon used as the "rollover" image
* @see #getRolloverIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The rollover icon for the button.")
public void setRolloverIcon(Icon rolloverIcon) {
Icon oldValue = this.rolloverIcon;
this.rolloverIcon = rolloverIcon;
firePropertyChange(ROLLOVER_ICON_CHANGED_PROPERTY, oldValue, rolloverIcon);
if (accessibleContext != null) {
*** 610,624 ****
/**
* Sets the rollover selected icon for the button.
* @param rolloverSelectedIcon the icon used as the
* "selected rollover" image
* @see #getRolloverSelectedIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The rollover selected icon for the button.
*/
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) {
Icon oldValue = this.rolloverSelectedIcon;
this.rolloverSelectedIcon = rolloverSelectedIcon;
firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, oldValue, rolloverSelectedIcon);
if (accessibleContext != null) {
--- 590,602 ----
/**
* Sets the rollover selected icon for the button.
* @param rolloverSelectedIcon the icon used as the
* "selected rollover" image
* @see #getRolloverSelectedIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The rollover selected icon for the button.")
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) {
Icon oldValue = this.rolloverSelectedIcon;
this.rolloverSelectedIcon = rolloverSelectedIcon;
firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, oldValue, rolloverSelectedIcon);
if (accessibleContext != null) {
*** 662,676 ****
/**
* Sets the disabled icon for the button.
* @param disabledIcon the icon used as the disabled image
* @see #getDisabledIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The disabled icon for the button.
*/
public void setDisabledIcon(Icon disabledIcon) {
Icon oldValue = this.disabledIcon;
this.disabledIcon = disabledIcon;
firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldValue, disabledIcon);
if (accessibleContext != null) {
--- 640,652 ----
/**
* Sets the disabled icon for the button.
* @param disabledIcon the icon used as the disabled image
* @see #getDisabledIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The disabled icon for the button.")
public void setDisabledIcon(Icon disabledIcon) {
Icon oldValue = this.disabledIcon;
this.disabledIcon = disabledIcon;
firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldValue, disabledIcon);
if (accessibleContext != null) {
*** 715,729 ****
/**
* Sets the disabled selection icon for the button.
* @param disabledSelectedIcon the icon used as the disabled
* selection image
* @see #getDisabledSelectedIcon
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: The disabled selection icon for the button.
*/
public void setDisabledSelectedIcon(Icon disabledSelectedIcon) {
Icon oldValue = this.disabledSelectedIcon;
this.disabledSelectedIcon = disabledSelectedIcon;
firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, oldValue, disabledSelectedIcon);
if (accessibleContext != null) {
--- 691,703 ----
/**
* Sets the disabled selection icon for the button.
* @param disabledSelectedIcon the icon used as the disabled
* selection image
* @see #getDisabledSelectedIcon
*/
+ @BeanProperty(visualUpdate = true, description
+ = "The disabled selection icon for the button.")
public void setDisabledSelectedIcon(Icon disabledSelectedIcon) {
Icon oldValue = this.disabledSelectedIcon;
this.disabledSelectedIcon = disabledSelectedIcon;
firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, oldValue, disabledSelectedIcon);
if (accessibleContext != null) {
*** 766,783 ****
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the legal
* values listed above
- * @beaninfo
- * bound: true
- * enum: TOP SwingConstants.TOP
- * CENTER SwingConstants.CENTER
- * BOTTOM SwingConstants.BOTTOM
- * attribute: visualUpdate true
- * description: The vertical alignment of the icon and text.
*/
public void setVerticalAlignment(int alignment) {
if (alignment == verticalAlignment) return;
int oldValue = verticalAlignment;
verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, oldValue, verticalAlignment); repaint();
--- 740,755 ----
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the legal
* values listed above
*/
+ @BeanProperty(visualUpdate = true, enumerationValues = {
+ "SwingConstants.TOP",
+ "SwingConstants.CENTER",
+ "SwingConstants.BOTTOM"}, description
+ = "The vertical alignment of the icon and text.")
public void setVerticalAlignment(int alignment) {
if (alignment == verticalAlignment) return;
int oldValue = verticalAlignment;
verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, oldValue, verticalAlignment); repaint();
*** 815,834 ****
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the
* valid values
- * @beaninfo
- * bound: true
- * enum: LEFT SwingConstants.LEFT
- * CENTER SwingConstants.CENTER
- * RIGHT SwingConstants.RIGHT
- * LEADING SwingConstants.LEADING
- * TRAILING SwingConstants.TRAILING
- * attribute: visualUpdate true
- * description: The horizontal alignment of the icon and text.
*/
public void setHorizontalAlignment(int alignment) {
if (alignment == horizontalAlignment) return;
int oldValue = horizontalAlignment;
horizontalAlignment = checkHorizontalKey(alignment,
"horizontalAlignment");
--- 787,804 ----
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the
* valid values
*/
+ @BeanProperty(visualUpdate = true, enumerationValues = {
+ "SwingConstants.LEFT",
+ "SwingConstants.CENTER",
+ "SwingConstants.RIGHT",
+ "SwingConstants.LEADING",
+ "SwingConstants.TRAILING"}, description
+ = "The horizontal alignment of the icon and text.")
public void setHorizontalAlignment(int alignment) {
if (alignment == horizontalAlignment) return;
int oldValue = horizontalAlignment;
horizontalAlignment = checkHorizontalKey(alignment,
"horizontalAlignment");
*** 858,875 ****
* <ul>
* <li>{@code SwingConstants.CENTER} (the default)
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
- * @beaninfo
- * bound: true
- * enum: TOP SwingConstants.TOP
- * CENTER SwingConstants.CENTER
- * BOTTOM SwingConstants.BOTTOM
- * attribute: visualUpdate true
- * description: The vertical position of the text relative to the icon.
*/
public void setVerticalTextPosition(int textPosition) {
if (textPosition == verticalTextPosition) return;
int oldValue = verticalTextPosition;
verticalTextPosition = checkVerticalKey(textPosition, "verticalTextPosition");
firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue, verticalTextPosition);
--- 828,843 ----
* <ul>
* <li>{@code SwingConstants.CENTER} (the default)
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
*/
+ @BeanProperty(visualUpdate = true, enumerationValues = {
+ "SwingConstants.TOP",
+ "SwingConstants.CENTER",
+ "SwingConstants.BOTTOM"}, description
+ = "The vertical position of the text relative to the icon.")
public void setVerticalTextPosition(int textPosition) {
if (textPosition == verticalTextPosition) return;
int oldValue = verticalTextPosition;
verticalTextPosition = checkVerticalKey(textPosition, "verticalTextPosition");
firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue, verticalTextPosition);
*** 903,922 ****
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING} (the default)
* </ul>
* @exception IllegalArgumentException if <code>textPosition</code>
* is not one of the legal values listed above
- * @beaninfo
- * bound: true
- * enum: LEFT SwingConstants.LEFT
- * CENTER SwingConstants.CENTER
- * RIGHT SwingConstants.RIGHT
- * LEADING SwingConstants.LEADING
- * TRAILING SwingConstants.TRAILING
- * attribute: visualUpdate true
- * description: The horizontal position of the text relative to the icon.
*/
public void setHorizontalTextPosition(int textPosition) {
if (textPosition == horizontalTextPosition) return;
int oldValue = horizontalTextPosition;
horizontalTextPosition = checkHorizontalKey(textPosition,
"horizontalTextPosition");
--- 871,888 ----
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING} (the default)
* </ul>
* @exception IllegalArgumentException if <code>textPosition</code>
* is not one of the legal values listed above
*/
+ @BeanProperty(visualUpdate = true, enumerationValues = {
+ "SwingConstants.LEFT",
+ "SwingConstants.CENTER",
+ "SwingConstants.RIGHT",
+ "SwingConstants.LEADING",
+ "SwingConstants.TRAILING"}, description
+ = "The horizontal position of the text relative to the icon.")
public void setHorizontalTextPosition(int textPosition) {
if (textPosition == horizontalTextPosition) return;
int oldValue = horizontalTextPosition;
horizontalTextPosition = checkHorizontalKey(textPosition,
"horizontalTextPosition");
*** 949,964 ****
* This is a JavaBeans bound property.
*
* @param iconTextGap the space between icon and text if these properties are set.
* @since 1.4
* @see #getIconTextGap
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: If both the icon and text properties are set, this
- * property defines the space between them.
*/
public void setIconTextGap(int iconTextGap) {
int oldValue = this.iconTextGap;
this.iconTextGap = iconTextGap;
iconTextGapSet = true;
firePropertyChange("iconTextGap", oldValue, iconTextGap);
--- 915,927 ----
* This is a JavaBeans bound property.
*
* @param iconTextGap the space between icon and text if these properties are set.
* @since 1.4
* @see #getIconTextGap
*/
+ @BeanProperty(visualUpdate = true, description
+ = "If both the icon and text properties are set, this property defines the space between them.")
public void setIconTextGap(int iconTextGap) {
int oldValue = this.iconTextGap;
this.iconTextGap = iconTextGap;
iconTextGapSet = true;
firePropertyChange("iconTextGap", oldValue, iconTextGap);
*** 1093,1107 ****
* @see Action
* @see #getAction
* @see #configurePropertiesFromAction
* @see #createActionPropertyChangeListener
* @see #actionPropertyChanged
- * @beaninfo
- * bound: true
- * attribute: 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)) {
action = a;
if (oldValue!=null) {
--- 1056,1068 ----
* @see Action
* @see #getAction
* @see #configurePropertiesFromAction
* @see #createActionPropertyChangeListener
* @see #actionPropertyChanged
*/
+ @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)) {
action = a;
if (oldValue!=null) {
*** 1391,1405 ****
* in which case they ignore this.
*
* @param b if true and border property is not <code>null</code>,
* the border is painted
* @see #isBorderPainted
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: Whether the border should be painted.
*/
public void setBorderPainted(boolean b) {
boolean oldValue = paintBorder;
paintBorder = b;
borderPaintedSet = true;
firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldValue, paintBorder);
--- 1352,1364 ----
* in which case they ignore this.
*
* @param b if true and border property is not <code>null</code>,
* the border is painted
* @see #isBorderPainted
*/
+ @BeanProperty(visualUpdate = true, description
+ = "Whether the border should be painted.")
public void setBorderPainted(boolean b) {
boolean oldValue = paintBorder;
paintBorder = b;
borderPaintedSet = true;
firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldValue, paintBorder);
*** 1441,1455 ****
* Some look and feels might not paint focus state;
* they will ignore this property.
*
* @param b if <code>true</code>, the focus state should be painted
* @see #isFocusPainted
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: Whether focus should be painted
*/
public void setFocusPainted(boolean b) {
boolean oldValue = paintFocus;
paintFocus = b;
firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, oldValue, paintFocus);
if (b != oldValue && isFocusOwner()) {
--- 1400,1412 ----
* Some look and feels might not paint focus state;
* they will ignore this property.
*
* @param b if <code>true</code>, the focus state should be painted
* @see #isFocusPainted
*/
+ @BeanProperty(visualUpdate = true, description
+ = "Whether focus should be painted")
public void setFocusPainted(boolean b) {
boolean oldValue = paintFocus;
paintFocus = b;
firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, oldValue, paintFocus);
if (b != oldValue && isFocusOwner()) {
*** 1484,1499 ****
*
* @param b if true, the content should be filled; if false
* the content area is not filled
* @see #isContentAreaFilled
* @see #setOpaque
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: Whether the button should paint the content area
- * or leave it transparent.
*/
public void setContentAreaFilled(boolean b) {
boolean oldValue = contentAreaFilled;
contentAreaFilled = b;
contentAreaFilledSet = true;
firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY, oldValue, contentAreaFilled);
--- 1441,1453 ----
*
* @param b if true, the content should be filled; if false
* the content area is not filled
* @see #isContentAreaFilled
* @see #setOpaque
*/
+ @BeanProperty(visualUpdate = true, description
+ = "Whether the button should paint the content area or leave it transparent.")
public void setContentAreaFilled(boolean b) {
boolean oldValue = contentAreaFilled;
contentAreaFilled = b;
contentAreaFilledSet = true;
firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY, oldValue, contentAreaFilled);
*** 1520,1534 ****
* Some look and feels might not implement rollover effects;
* they will ignore this property.
*
* @param b if <code>true</code>, rollover effects should be painted
* @see #isRolloverEnabled
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: Whether rollover effects should be enabled.
*/
public void setRolloverEnabled(boolean b) {
boolean oldValue = rolloverEnabled;
rolloverEnabled = b;
rolloverEnabledSet = true;
firePropertyChange(ROLLOVER_ENABLED_CHANGED_PROPERTY, oldValue, rolloverEnabled);
--- 1474,1486 ----
* Some look and feels might not implement rollover effects;
* they will ignore this property.
*
* @param b if <code>true</code>, rollover effects should be painted
* @see #isRolloverEnabled
*/
+ @BeanProperty(visualUpdate = true, description
+ = "Whether rollover effects should be enabled.")
public void setRolloverEnabled(boolean b) {
boolean oldValue = rolloverEnabled;
rolloverEnabled = b;
rolloverEnabledSet = true;
firePropertyChange(ROLLOVER_ENABLED_CHANGED_PROPERTY, oldValue, rolloverEnabled);
*** 1567,1582 ****
* will be underlined to indicate the mnemonic to the user.
*
* @param mnemonic the key code which represents the mnemonic
* @see java.awt.event.KeyEvent
* @see #setDisplayedMnemonicIndex
- *
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: the keyboard character mnemonic
*/
public void setMnemonic(int mnemonic) {
int oldValue = getMnemonic();
model.setMnemonic(mnemonic);
updateMnemonicProperties();
}
--- 1519,1531 ----
* will be underlined to indicate the mnemonic to the user.
*
* @param mnemonic the key code which represents the mnemonic
* @see java.awt.event.KeyEvent
* @see #setDisplayedMnemonicIndex
*/
+ @BeanProperty(visualUpdate = true, description
+ = "the keyboard character mnemonic")
public void setMnemonic(int mnemonic) {
int oldValue = getMnemonic();
model.setMnemonic(mnemonic);
updateMnemonicProperties();
}
*** 1587,1601 ****
* to handle character values which fall between 'a' and 'z' or
* 'A' and 'Z'.
*
* @param mnemonic a char specifying the mnemonic value
* @see #setMnemonic(int)
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: the keyboard character mnemonic
*/
public void setMnemonic(char mnemonic) {
int vk = (int) mnemonic;
if(vk >= 'a' && vk <='z')
vk -= ('a' - 'A');
setMnemonic(vk);
--- 1536,1548 ----
* to handle character values which fall between 'a' and 'z' or
* 'A' and 'Z'.
*
* @param mnemonic a char specifying the mnemonic value
* @see #setMnemonic(int)
*/
+ @BeanProperty(visualUpdate = true, description
+ = "the keyboard character mnemonic")
public void setMnemonic(char mnemonic) {
int vk = (int) mnemonic;
if(vk >= 'a' && vk <='z')
vk -= ('a' - 'A');
setMnemonic(vk);
*** 1620,1636 ****
* @since 1.4
* @param index Index into the String to underline
* @exception IllegalArgumentException will be thrown if <code>index</code>
* is >= length of the text, or < -1
* @see #getDisplayedMnemonicIndex
- *
- * @beaninfo
- * bound: true
- * attribute: visualUpdate true
- * description: the index into the String to draw the keyboard character
- * mnemonic at
*/
public void setDisplayedMnemonicIndex(int index)
throws IllegalArgumentException {
int oldValue = mnemonicIndex;
if (index == -1) {
mnemonicIndex = -1;
--- 1567,1579 ----
* @since 1.4
* @param index Index into the String to underline
* @exception IllegalArgumentException will be thrown if <code>index</code>
* is >= length of the text, or < -1
* @see #getDisplayedMnemonicIndex
*/
+ @BeanProperty(visualUpdate = true, description
+ = "the index into the String to draw the keyboard character mnemonic at")
public void setDisplayedMnemonicIndex(int index)
throws IllegalArgumentException {
int oldValue = mnemonicIndex;
if (index == -1) {
mnemonicIndex = -1;
*** 1741,1754 ****
/**
* Sets the model that this button represents.
* @param newModel the new <code>ButtonModel</code>
* @see #getModel
- * @beaninfo
- * bound: true
- * description: Model that the Button uses.
*/
public void setModel(ButtonModel newModel) {
ButtonModel oldModel = getModel();
if (oldModel != null) {
--- 1684,1696 ----
/**
* Sets the model that this button represents.
* @param newModel the new <code>ButtonModel</code>
* @see #getModel
*/
+ @BeanProperty(description
+ = "Model that the Button uses.")
public void setModel(ButtonModel newModel) {
ButtonModel oldModel = getModel();
if (oldModel != null) {
*** 1802,1817 ****
/**
* Sets the L&F object that renders this component.
* @param ui the <code>ButtonUI</code> L&F object
* @see #getUI
- * @beaninfo
- * bound: true
- * hidden: true
- * attribute: visualUpdate true
- * description: The UI object that implements the LookAndFeel.
*/
public void setUI(ButtonUI ui) {
super.setUI(ui);
// disabled icons are generated by the LF so they should be unset here
if (disabledIcon instanceof UIResource) {
setDisabledIcon(null);
--- 1744,1756 ----
/**
* Sets the L&F object that renders this component.
* @param ui the <code>ButtonUI</code> L&F object
* @see #getUI
*/
+ @BeanProperty(hidden = true, visualUpdate = true, description
+ = "The UI object that implements the LookAndFeel.")
public void setUI(ButtonUI ui) {
super.setUI(ui);
// disabled icons are generated by the LF so they should be unset here
if (disabledIcon instanceof UIResource) {
setDisabledIcon(null);
*** 1895,1904 ****
--- 1834,1844 ----
*
* @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);
}
/**
*** 1952,1961 ****
--- 1892,1902 ----
*
* @return all of the <code>ActionListener</code>s added or an empty
* array if no listeners have been added
* @since 1.4
*/
+ @BeanProperty(bound = false)
public ActionListener[] getActionListeners() {
return listenerList.getListeners(ActionListener.class);
}
/**
*** 2120,2134 ****
/**
* Sets the label text.
*
* @param label a <code>String</code> containing the text
* @deprecated - Replaced by <code>setText(text)</code>
- * @beaninfo
- * bound: true
- * description: Replace by setText(text)
*/
@Deprecated
public void setLabel(String label) {
setText(label);
}
/**
--- 2061,2074 ----
/**
* Sets the label text.
*
* @param label a <code>String</code> containing the text
* @deprecated - Replaced by <code>setText(text)</code>
*/
@Deprecated
+ @BeanProperty(description
+ = "Replace by setText(text)")
public void setLabel(String label) {
setText(label);
}
/**
*** 2153,2162 ****
--- 2093,2103 ----
*
* @return all of the <code>ItemListener</code>s added or an empty
* array if no listeners have been added
* @since 1.4
*/
+ @BeanProperty(bound = false)
public ItemListener[] getItemListeners() {
return listenerList.getListeners(ItemListener.class);
}
/**
*** 2164,2173 ****
--- 2105,2115 ----
* <code>null</code> if the button is not selected.
*
* @return an array containing 1 Object: the text of the button,
* if the item is selected; otherwise <code>null</code>
*/
+ @BeanProperty(bound = false)
public Object[] getSelectedObjects() {
if (isSelected() == false) {
return null;
}
Object[] selectedObjects = new Object[1];