SUGGESTED FIX
Name: dkR10074 Date: 07/22/2003
------- List.java -------
*** //C/Tools/forte4j/platform/intel-win/bin/util/tmp/sccs.001808 Mon May 12
14:47:14 2003
--- List.java Mon May 12 14:45:49 2003
***************
*** 45,56 ****
* <img src="doc-files/List-1.gif"
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is
selected." ALIGN=center HSPACE=10 VSPACE=7>
* <p>
! * Clicking on an item that isn't selected selects it. Clicking on
* an item that is already selected deselects it. In the preceding
* example, only one item from the scrolling list can be selected
* at a time, since the second argument when creating the new scrolling
! * list is <code>false</code>. Selecting an item causes any other
! * selected item to be automatically deselected.
* <p>
* Note that the list in the example shown was created with four visible
* rows. Once the list has been created, the number of visible rows
--- 45,57 ----
* <img src="doc-files/List-1.gif"
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is
selected." ALIGN=center HSPACE=10 VSPACE=7>
* <p>
! * If the List allows multiple selections, then clicking on
* an item that is already selected deselects it. In the preceding
* example, only one item from the scrolling list can be selected
* at a time, since the second argument when creating the new scrolling
! * list is <code>false</code>. If the List does not allow multiple
! * selections, selecting an item causes any other selected item
! * to be deselected.
* <p>
* Note that the list in the example shown was created with four visible
* rows. Once the list has been created, the number of visible rows
***************
*** 399,404 ****
--- 400,407 ----
/**
* Removes the first occurrence of an item from the list.
+ * If the specified item is selected, and is the only selected
+ * item in the list, the list is set to have no selection.
* @param item the item to remove from the list
* @exception IllegalArgumentException
* if the item doesn't exist in the list
***************
*** 415,422 ****
}
/**
! * Remove the item at the specified position
* from this scrolling list.
* @param position the index of the item to delete
* @see #add(String, int)
* @since JDK1.1
--- 418,427 ----
}
/**
! * Removes the item at the specified position
* from this scrolling list.
+ * If the item with the specified position is selected, and is the
+ * only selected item in the list, the list is set to have no selection.
* @param position the index of the item to delete
* @see #add(String, int)
* @since JDK1.1
***************
*** 438,446 ****
/**
* Gets the index of the selected item on the list,
! * @return the index of the selected item, or
! * <code>-1</code> if no item is selected,
! * or if more that one item is selected
* @see #select
* @see #deselect
* @see #isIndexSelected
--- 443,452 ----
/**
* Gets the index of the selected item on the list,
! *
! * @return the index of the selected item;
! * if no item is selected, or if multiple items are
! * selected, <code>-1</code> is returned.
* @see #select
* @see #deselect
* @see #isIndexSelected
***************
*** 452,460 ****
/**
* Gets the selected indexes on the list.
! * @return an array of the selected indexes
! * of this scrolling list; if no items are
! * selected, a zero-length array is returned
* @see #select
* @see #deselect
* @see #isIndexSelected
--- 458,466 ----
/**
* Gets the selected indexes on the list.
! *
! * @return an array of the selected indexes on this scrolling list;
! * if no item is selected, a zero-length array is returned.
* @see #select
* @see #deselect
* @see #isIndexSelected
***************
*** 469,476 ****
/**
* Gets the selected item on this scrolling list.
! * @return the selected item on the list,
! * or <code>null</code> if no item is selected
* @see #select
* @see #deselect
* @see #isIndexSelected
--- 475,484 ----
/**
* Gets the selected item on this scrolling list.
! *
! * @return the selected item on the list;
! * if no item is selected, or if multiple items are
! * selected, <code>null</code> is returned.
* @see #select
* @see #deselect
* @see #isIndexSelected
***************
*** 482,489 ****
/**
* Gets the selected items on this scrolling list.
! * @return an array of the selected items
! * on this scrolling list
* @see #select
* @see #deselect
* @see #isIndexSelected
--- 490,498 ----
/**
* Gets the selected items on this scrolling list.
! *
! * @return an array of the selected items on this scrolling list;
! * if no item is selected, a zero-length array is returned.
* @see #select
* @see #deselect
* @see #isIndexSelected
***************
*** 498,504 ****
}
/**
! * Returns the selected items on the list in an array of objects.
* @see ItemSelectable
*/
public Object[] getSelectedObjects() {
--- 507,517 ----
}
/**
! * Gets the selected items on this scrolling list in an array of Objects.
! * @return an array of <code>Object</code>s representing the
! * selected items on this scrolling list;
! * if no item is selected, a zero-length array is returned.
! * @see #getSelectedItems
* @see ItemSelectable
*/
public Object[] getSelectedObjects() {
======================================================================
|
EVALUATION
###@###.### 2003-05-20
Name: dkR10074 Date: 07/22/2003
A mistake was made in the java.awt.List class description of the doc
(see doc/api/java/awt/List.html).
Here is an excerpt from there:
---8<------------------------------------
For example, the code...
List lst = new List(4, false);
lst.add("Mercury");
lst.add("Venus");
lst.add("Earth");
lst.add("JavaSoft");
lst.add("Mars");
lst.add("Jupiter");
lst.add("Saturn");
lst.add("Uranus");
lst.add("Neptune");
lst.add("Pluto");
cnt.add(lst);
where cnt is a container, produces the following scrolling list:
[an image]
Clicking on an item that isn't selected selects it. Clicking on
an item that is already selected deselects it.
In the preceding example, only one item from the scrolling list
can be selected at a time, since the second argument when
creating the new scrolling list is false. Selecting an item
causes any other selected item to be automatically deselected.
---8<------------------------------------
The sentences
"Clicking on an item that isn't selected selects it.
Clicking on an item that is already selected deselects it."
are true if a list is in a multiple-selection mode only. If a list
is in a single-selection mode, any click on list's item will
select a clicked item.
---
The Javadoc is changed to be more definite
what happens if a java.awt.List component is in
a single-selection or a multiple-selection mode.
Please see suggested fix.
CCC decision, 2003/05/19
###@###.### 2003-07-22
======================================================================
|