SUGGESTED FIX
Name: pzR10082 Date: 06/05/2001
*** /tmp/geta24446 Tue Jun 5 12:26:51 2001
--- AbstractButton.java Tue Jun 5 12:23:43 2001
***************
*** 1015,1021 ****
* <code>Action</code> instance. The properties
* which are set may differ for subclasses. By default,
* the properties which get set are <code>Text, Icon,
! * Enabled, ToolTipText</code> and <code>Mnemonic</code>.
* <p>
* If the <code>Action</code> passed in is <code>null</code>,
* the following things will occur:
--- 1015,1021 ----
* <code>Action</code> instance. The properties
* which are set may differ for subclasses. By default,
* the properties which get set are <code>Text, Icon,
! * Enabled, ToolTipText, ActionCommand</code>, and <code>Mnemonic</code>.
* <p>
* If the <code>Action</code> passed in is <code>null</code>,
* the following things will occur:
***************
*** 1050,1055 ****
--- 1050,1057 ----
* from the <code>Action</code>,
* <li><code>Action.MNEMONIC</code> - set the <code>Mnemonic</code>
* property from the <code>Action</code>,
+ * <li><code>Action.ACTION_COMMAND_KEY</code> - set the
+ * <code>ActionCommand</code> property from the <code>Action</code>,
* <li><code>"enabled"</code> - set <code>Enabled</code> property
* from the <code>Action</code>
* </ul>
***************
*** 1077,1083 ****
if (types == null) {
String[] alltypes = { Action.MNEMONIC_KEY, Action.NAME,
Action.SHORT_DESCRIPTION, Action.SMALL_ICON,
! "enabled" };
types = alltypes;
}
for (int i=0; i<types.length; i++) {
--- 1079,1085 ----
if (types == null) {
String[] alltypes = { Action.MNEMONIC_KEY, Action.NAME,
Action.SHORT_DESCRIPTION, Action.SMALL_ICON,
! Action.ACTION_COMMAND_KEY, "enabled" };
types = alltypes;
}
for (int i=0; i<types.length; i++) {
***************
*** 1093,1098 ****
--- 1095,1102 ----
setToolTipText(a!=null ? (String)a.getValue(type) : null);
} else if (type.equals(Action.SMALL_ICON)) {
setIcon(a!=null ? (Icon)a.getValue(type) : null);
+ } else if (type.equals(Action.ACTION_COMMAND_KEY)) {
+ setActionCommand(a!=null? (String)a.getValue(type) : null);
} else if (type.equals("enabled")) {
setEnabled(a!=null ? a.isEnabled() : true);
}
***************
*** 1159,1165 ****
button.setMnemonic(mn.intValue());
button.invalidate();
button.repaint();
! }
}
}
}
--- 1163,1171 ----
button.setMnemonic(mn.intValue());
button.invalidate();
button.repaint();
! } else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) {
! button.setActionCommand((String)e.getNewValue());
! }
}
}
}
------- JButton.java -------
*** /tmp/sccs.QCHsW7 Tue May 22 19:31:18 2001
--- JButton.java Tue May 22 19:07:12 2001
***************
*** 216,222 ****
* according to values from the <code>Action</code> instance.
* The properties which get set may differ for <code>AbstractButton</code>
* subclasses. By default, the properties which get set are
! * <code>Text, Icon, Enabled, ToolTipText</code>, and
* <code>Mnemonic</code>.
*
* @param a the <code>Action</code> from which to get the
--- 216,222 ----
* according to values from the <code>Action</code> instance.
* The properties which get set may differ for <code>AbstractButton</code>
* subclasses. By default, the properties which get set are
! * <code>Text, Icon, Enabled, ToolTipText, ActionCommand</code>, and
* <code>Mnemonic</code>.
*
* @param a the <code>Action</code> from which to get the
***************
*** 230,236 ****
// Action.NAME differently from AbstractButton, so we don't call
// super.configurePropertiesFromAction(a) here.
String[] types = { Action.MNEMONIC_KEY, Action.SHORT_DESCRIPTION,
! Action.SMALL_ICON, "enabled" };
configurePropertiesFromAction(a, types);
Boolean hide = (Boolean)getClientProperty("hideActionText");
--- 230,237 ----
// Action.NAME differently from AbstractButton, so we don't call
// super.configurePropertiesFromAction(a) here.
String[] types = { Action.MNEMONIC_KEY, Action.SHORT_DESCRIPTION,
! Action.SMALL_ICON, Action.ACTION_COMMAND_KEY,
! "enabled" };
configurePropertiesFromAction(a, types);
Boolean hide = (Boolean)getClientProperty("hideActionText");
*** /tmp/geta24451 Tue Jun 5 12:27:09 2001
--- JCheckBox.java Tue Jun 5 12:24:00 2001
***************
*** 220,230 ****
/**
! * Factory method which sets the ActionEvent source's properties
! * according to values from the Action instance. The properties
! * which are set may differ for subclasses.
* By default, the properties which get set are <code>Text, Mnemonic,
! * Enabled</code>, and <code>ToolTipText</code>.
*
* @param a the Action from which to get the properties, or null
* @since 1.3
--- 220,230 ----
/**
! * Factory method which sets the <code>ActionEvent</code> source's
! * properties according to values from the Action instance. The
! * properties which are set may differ for subclasses.
* By default, the properties which get set are <code>Text, Mnemonic,
! * Enabled, ActionCommand</code>, and <code>ToolTipText</code>.
*
* @param a the Action from which to get the properties, or null
* @since 1.3
***************
*** 233,239 ****
*/
protected void configurePropertiesFromAction(Action a) {
String[] types = { Action.MNEMONIC_KEY, Action.NAME,
! Action.SHORT_DESCRIPTION, "enabled" };
configurePropertiesFromAction(a, types);
}
--- 233,240 ----
*/
protected void configurePropertiesFromAction(Action a) {
String[] types = { Action.MNEMONIC_KEY, Action.NAME,
! Action.SHORT_DESCRIPTION,
! Action.ACTION_COMMAND_KEY, "enabled" };
configurePropertiesFromAction(a, types);
}
***************
*** 263,279 ****
Action action = (Action)e.getSource();
action.removePropertyChangeListener(this);
} else {
! if (e.getPropertyName().equals(Action.NAME)) {
String text = (String) e.getNewValue();
button.setText(text);
button.repaint();
! } else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) {
String text = (String) e.getNewValue();
button.setToolTipText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
button.setEnabled(enabledState.booleanValue());
button.repaint();
}
}
}
--- 264,282 ----
Action action = (Action)e.getSource();
action.removePropertyChangeListener(this);
} else {
! if (propertyName.equals(Action.NAME)) {
String text = (String) e.getNewValue();
button.setText(text);
button.repaint();
! } else if (propertyName.equals(Action.SHORT_DESCRIPTION)) {
String text = (String) e.getNewValue();
button.setToolTipText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
button.setEnabled(enabledState.booleanValue());
button.repaint();
+ } else if (propertyName.equals(Action.ACTION_COMMAND_KEY)) {
+ button.setActionCommand((String)e.getNewValue());
}
}
}
*** /tmp/geta24622 Tue Jun 5 12:28:16 2001
--- JMenu.java Tue Jun 5 12:24:49 2001
***************
*** 620,637 ****
}
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
! if (e.getPropertyName().equals(Action.NAME)) {
String text = (String) e.getNewValue();
menuItem.setText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
menuItem.setEnabled(enabledState.booleanValue());
! } else if (e.getPropertyName().equals(Action.SMALL_ICON)) {
Icon icon = (Icon) e.getNewValue();
menuItem.setIcon(icon);
menuItem.invalidate();
menuItem.repaint();
! }
}
public void setTarget(JMenuItem b) {
this.menuItem = b;
--- 620,639 ----
}
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
! if (propertyName.equals(Action.NAME)) {
String text = (String) e.getNewValue();
menuItem.setText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
menuItem.setEnabled(enabledState.booleanValue());
! } else if (propertyName.equals(Action.SMALL_ICON)) {
Icon icon = (Icon) e.getNewValue();
menuItem.setIcon(icon);
menuItem.invalidate();
menuItem.repaint();
! } else if (propertyName.equals(Action.ACTION_COMMAND_KEY)) {
! menuItem.setActionCommand((String)e.getNewValue());
! }
}
public void setTarget(JMenuItem b) {
this.menuItem = b;
***************
*** 1093,1099 ****
* <code>Action</code> instance. The properties
* which are set may differ for subclasses. By default,
* the properties which get set are <code>Text, Icon, Enabled,
! * ToolTipText</code> and <code>Mnemonic</code>.
*
* @param a the <code>Action</code> from which to get the properties,
* or <code>null</code>
--- 1095,1101 ----
* <code>Action</code> instance. The properties
* which are set may differ for subclasses. By default,
* the properties which get set are <code>Text, Icon, Enabled,
! * ToolTipText, ActionCommand</code>, and <code>Mnemonic</code>.
*
* @param a the <code>Action</code> from which to get the properties,
* or <code>null</code>
*** /tmp/geta24436 Tue Jun 5 12:26:26 2001
--- JRadioButton.java Tue Jun 5 12:23:18 2001
***************
*** 185,195 ****
/**
! * Factory method which sets the ActionEvent source's properties
! * according to values from the Action instance. The properties
! * which are set may differ for subclasses.
* By default, the properties which get set are <code>Text, Mnemonic,
! * Enabled,</code> and <code>ToolTipText</code>.
*
* @param a the Action from which to get the properties, or null
* @since 1.3
--- 185,195 ----
/**
! * Factory method which sets the <code>ActionEvent</code> source's
! * properties according to values from the Action instance. The
! * properties which are set may differ for subclasses.
* By default, the properties which get set are <code>Text, Mnemonic,
! * Enabled, ActionCommand</code>, and <code>ToolTipText</code>.
*
* @param a the Action from which to get the properties, or null
* @since 1.3
***************
*** 198,204 ****
*/
protected void configurePropertiesFromAction(Action a) {
String[] types = { Action.MNEMONIC_KEY, Action.NAME,
! Action.SHORT_DESCRIPTION, "enabled" };
configurePropertiesFromAction(a, types);
}
--- 198,205 ----
*/
protected void configurePropertiesFromAction(Action a) {
String[] types = { Action.MNEMONIC_KEY, Action.NAME,
! Action.SHORT_DESCRIPTION,
! Action.ACTION_COMMAND_KEY, "enabled" };
configurePropertiesFromAction(a, types);
}
***************
*** 228,244 ****
Action action = (Action)e.getSource();
action.removePropertyChangeListener(this);
} else {
! if (e.getPropertyName().equals(Action.NAME)) {
String text = (String) e.getNewValue();
button.setText(text);
button.repaint();
! } else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) {
String text = (String) e.getNewValue();
button.setToolTipText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
button.setEnabled(enabledState.booleanValue());
button.repaint();
}
}
}
--- 229,247 ----
Action action = (Action)e.getSource();
action.removePropertyChangeListener(this);
} else {
! if (propertyName.equals(Action.NAME)) {
String text = (String) e.getNewValue();
button.setText(text);
button.repaint();
! } else if (propertyName.equals(Action.SHORT_DESCRIPTION)) {
String text = (String) e.getNewValue();
button.setToolTipText(text);
} else if (propertyName.equals("enabled")) {
Boolean enabledState = (Boolean) e.getNewValue();
button.setEnabled(enabledState.booleanValue());
button.repaint();
+ } else if (propertyName.equals(Action.ACTION_COMMAND_KEY)) {
+ button.setActionCommand((String)e.getNewValue());
}
}
}
###@###.### 2001-06-05
======================================================================
|