Lines Matching defs:index

242      * Gets the item located at the specified index of this menu.
243 * @param index the position of the item to be returned.
244 * @return the item located at the specified index.
246 public MenuItem getItem(int index) {
247 return getItemImpl(index);
254 final MenuItem getItemImpl(int index) {
255 return (MenuItem)items.elementAt(index);
300 * @param index the position at which the menu
305 * <code>index</code> is less than zero
309 public void insert(MenuItem menuitem, int index) {
311 if (index < 0) {
312 throw new IllegalArgumentException("index less than zero.");
318 /* Remove the item at index, nitems-index times
322 for (int i = index ; i < nitems; i++) {
323 tempItems.addElement(getItem(index));
324 remove(index);
341 * <code>insert(menuItem, index)</code>.
344 * @param index the position at which the menu item
349 * <code>index</code> is less than zero
353 public void insert(String label, int index) {
354 insert(new MenuItem(label), index);
367 * @param index the position at which the
370 * <code>index</code> is less than 0.
375 public void insertSeparator(int index) {
377 if (index < 0) {
378 throw new IllegalArgumentException("index less than zero.");
384 /* Remove the item at index, nitems-index times
388 for (int i = index ; i < nitems; i++) {
389 tempItems.addElement(getItem(index));
390 remove(index);
405 * Removes the menu item at the specified index from this menu.
406 * @param index the position of the item to be removed.
408 public void remove(int index) {
410 MenuItem mi = getItem(index);
411 items.removeElementAt(index);
416 peer.delItem(index);
430 int index = items.indexOf(item);
431 if (index >= 0) {
432 remove(index);