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 |
|
|
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 |
/*************************************************************************/ |
/*************************************************************************/ |
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 |
/*************************************************************************/ |
/*************************************************************************/ |
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; |