gurjeet
unread,Jul 6, 2009, 2:19:54 AM7/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mac Widgets for Java
Hi,
I am experimenting with the SourceList component for an application. I
just realized that the only way to implement action methods on the
individual SourceListItem s is the following:
1. Add a SourceListClickListener to the SourceList
2. Implement the sourceListItemClicked method
3. The method is called with a SourceListItem which got clicked on
Presumably one would have a HashTable with the keys being the
SourceListItems and the values being some object which implements the
function we want called when the item is clicked. Now, one looks up
the value object given the SourceListItem and call the function.
I was wondering if I got this right or not ? The reason I ask is that
I would have expected that one would simply be able to do something
like:
SouceListItem item = new SourceListItem("a");
item.addSourceListClickListener(
public void sourceListItemClicked(Button button, int clickCount)
{}
);
Now, whenever the item is clicked/interacted with, this method gets
called and one does not have to resort to a HashTable etc.
I would like to know the idea behind the former implementation instead
of the latter ?
Thanks,
Gurjeet