/[classpath]/classpath/java/awt/Choice.java
ViewVC logotype

Diff of /classpath/java/awt/Choice.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by fitzsim, Tue Feb 3 17:17:29 2004 UTC revision 1.16 by mark, Mon Oct 25 11:10:57 2004 UTC
# Line 1  Line 1 
1  /* Choice.java -- Java choice button widget.  /* Choice.java -- Java choice button widget.
2     Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 169  add(String item) Line 169  add(String item)
169        ChoicePeer cp = (ChoicePeer) peer;        ChoicePeer cp = (ChoicePeer) peer;
170        cp.add (item, i);        cp.add (item, i);
171      }      }
172      else if (selectedIndex == -1)
173        select(0);
174  }  }
175    
176  /*************************************************************************/  /*************************************************************************/
# Line 218  insert(String item, int index) Line 220  insert(String item, int index)
220        ChoicePeer cp = (ChoicePeer) peer;        ChoicePeer cp = (ChoicePeer) peer;
221        cp.add (item, index);        cp.add (item, index);
222      }      }
223      else if (selectedIndex == -1 || selectedIndex >= index)
224        select(0);
225  }  }
226    
227  /*************************************************************************/  /*************************************************************************/
# Line 261  remove(int index) Line 265  remove(int index)
265        ChoicePeer cp = (ChoicePeer) peer;        ChoicePeer cp = (ChoicePeer) peer;
266        cp.remove (index);        cp.remove (index);
267      }      }
268      else
269        {
270          if (getItemCount() == 0)
271            selectedIndex = -1;
272          else if (index == selectedIndex)
273            select(0);
274        }
275    
276    if (selectedIndex > index)    if (selectedIndex > index)
277      --selectedIndex;      --selectedIndex;

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26