Re: Programatically setting a SourceListItem to be 'selected'

1 view
Skip to first unread message
Message has been deleted

Ken Orr

unread,
Jul 7, 2009, 7:59:46 AM7/7/09
to mac-widget...@googlegroups.com
Hi Gurjeet,

SourceList has a setSelectedItem method on it:


-Ken

On Mon, Jul 6, 2009 at 8:45 PM, gurjeet <gur...@gmail.com> wrote:

Hi,

The application which I am playing with is a sort of a 'master-detail'
view. The SourceList is the master and a bunch of iTunesTable s are
the detail. The way I am setting things up, clicking on a different
item in the SourceList will change the table that the user is staring
at.

Now, when the application starts, the program will startup showing a
particular table. I want to programatically highlight the item in the
SourceList whose corresponding table is showing.

I expected an API call of the sort:

SourceListItem item = new SourceListItem("first item");
item.setSelected(true);

I can see that it will be a problem if someone sets multiple items as
selected. Maybe the API couldbe something like:

SourceListItem item = new SourceListItem("first Item");
SourceListItem item1 = new SourceListItem("f item");

SourceList list = new SourceList();
// add items to the list with appropriate categories..

list.setSelected(item); // sets the item as selected and unselects any
previously selected item

If this sounds like a good idea, I will submit an enhancement request.

Gurjeet


gurjeet

unread,
Jul 8, 2009, 6:34:37 PM7/8/09
to Mac Widgets for Java
Hi Ken,

I noticed it after having typed the email.

Thanks !
Gurjeet

On Jul 7, 4:59 am, Ken Orr <kenneth....@gmail.com> wrote:
> Hi Gurjeet,
> SourceList has a setSelectedItem method on it:
>
> http://exploding-pixels.com/google_code/javadoc_0.9.5/com/explodingpi...)
Reply all
Reply to author
Forward
0 new messages