src/share/classes/java/awt/List.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 280,289 **** --- 280,292 ---- public int getItemCount() { return countItems(); } /** + * Returns the number of items in the list. + * + * @return the number of items in the list * @deprecated As of JDK version 1.1, * replaced by <code>getItemCount()</code>. */ @Deprecated public int countItems() {
*** 331,340 **** --- 334,346 ---- public void add(String item) { addItem(item); } /** + * Adds the specified item to the end of the list. + * + * @param item the item to be added * @deprecated replaced by <code>add(String)</code>. */ @Deprecated public void addItem(String item) { addItem(item, -1);
*** 356,365 **** --- 362,376 ---- public void add(String item, int index) { addItem(item, index); } /** + * Adds the specified item to the the list + * at the position indicated by the index. + * + * @param item the item to be added + * @param index the position at which to add the item * @deprecated replaced by <code>add(String, int)</code>. */ @Deprecated public synchronized void addItem(String item, int index) { if (index < -1 || index >= items.size()) {
*** 453,462 **** --- 464,476 ---- public void remove(int position) { delItem(position); } /** + * Removes the item at the specified position. + * + * @param position the index of the item to delete * @deprecated replaced by <code>remove(String)</code> * and <code>remove(int)</code>. */ @Deprecated public void delItem(int position) {
*** 644,653 **** --- 658,671 ---- public boolean isIndexSelected(int index) { return isSelected(index); } /** + * Determines if the specified item in the list is selected. + * + * @param index specifies the item to be checked + * @return {@code true} if the item is selected; otherwise {@code false} * @deprecated As of JDK version 1.1, * replaced by <code>isIndexSelected(int)</code>. */ @Deprecated public boolean isSelected(int index) {
*** 670,689 **** --- 688,712 ---- return rows; } /** * Determines whether this list allows multiple selections. + * * @return <code>true</code> if this list allows multiple * selections; otherwise, <code>false</code> * @see #setMultipleMode * @since JDK1.1 */ public boolean isMultipleMode() { return allowsMultipleSelections(); } /** + * Determines whether this list allows multiple selections. + * + * @return {@code true} if this list allows multiple + * selections; otherwise {@code false} * @deprecated As of JDK version 1.1, * replaced by <code>isMultipleMode()</code>. */ @Deprecated public boolean allowsMultipleSelections() {
*** 707,716 **** --- 730,742 ---- public void setMultipleMode(boolean b) { setMultipleSelections(b); } /** + * Enables or disables multiple selection mode for this list. + * + * @param b {@code true} to enable multiple mode, {@code false} otherwise * @deprecated As of JDK version 1.1, * replaced by <code>setMultipleMode(boolean)</code>. */ @Deprecated public synchronized void setMultipleSelections(boolean b) {
*** 758,767 **** --- 784,798 ---- public Dimension getPreferredSize(int rows) { return preferredSize(rows); } /** + * Returns the preferred size of this component + * assuming it has the specified number of rows. + * + * @param rows the number of rows + * @return the preferred dimensions for displaying this list * @deprecated As of JDK version 1.1, * replaced by <code>getPreferredSize(int)</code>. */ @Deprecated public Dimension preferredSize(int rows) {
*** 808,817 **** --- 839,853 ---- public Dimension getMinimumSize(int rows) { return minimumSize(rows); } /** + * Returns the minimum dimensions for the list + * with the specified number of rows. + * + * @param rows the number of rows in the list + * @return the minimum dimensions for displaying this list * @deprecated As of JDK version 1.1, * replaced by <code>getMinimumSize(int)</code>. */ @Deprecated public Dimension minimumSize(int rows) {
*** 1144,1153 **** --- 1180,1193 ---- protected String paramString() { return super.paramString() + ",selected=" + getSelectedItem(); } /** + * Deletes the list items in the specified index range. + * + * @param start the beginning index of the range to delete + * @param end the ending index of the range to delete * @deprecated As of JDK version 1.1, * Not for public use in the future. * This method is expected to be retained only as a package * private method. */
*** 1288,1297 **** --- 1328,1340 ---- /* * JDK 1.3 serialVersionUID */ private static final long serialVersionUID = 7924617370136012829L; + /** + * Constructs new {@code AccessibleAWTList} + */ public AccessibleAWTList() { super(); List.this.addActionListener(this); List.this.addItemListener(this); }
*** 1489,1498 **** --- 1532,1548 ---- // [[[FIXME]]] need to finish implementing this!!! private List parent; private int indexInParent; + /** + * Constructs new {@code AccessibleAWTListChild} with the given + * parent {@code List} and 0-based index of this object in the parent. + * + * @param parent the parent {@code List} + * @param indexInParent the index in the parent + */ public AccessibleAWTListChild(List parent, int indexInParent) { this.parent = parent; this.setAccessibleParent(parent); this.indexInParent = indexInParent; }