Displaying users that are in a certain area of a building: GroupingList or Filters?

View: New views
4 Messages — Rating Filter:   Alert me  

Displaying users that are in a certain area of a building: GroupingList or Filters?

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

my current problem is that I need to display which user is currently in what area.

class Area {
  String id;
  String name;
}

class User {
  Area area;
}

A user can be in no area at all, then its area is null.

I want to have a view of all available areas and for each area a EventTableViewer with all the users of this area in it. I though of using a GroupingList but having trouble updating it when a user is switching areas.

Also the areas themself are highly dynamic, there can be areas added or removed during runtime.

I thought of having an EventList<Area> with all the areas that exist. Then, when this list changes, I would remove/create EventTableViewer for each area and now I need to fill in the users in each table viewer. I could filter each table viewer with its respective Area, if that is the preferred way? Or should I use a GroupingList for the users area? However GroupingList does not provide Support for EventList on its get(int) method. So I would have to wrap it somehow?

Thanks for any input,
Phil

re: Displaying users that are in a certain area of a building: GroupingList or Filters?

by Kevin Day-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I've run into something similar myself.  Lack of support for EventList members in GroupingList is most definitely a hassle.
 
Filtering may be your only option...
 
 
 
As an FYI, I suspect that the reason GroupingList doesn't support EventList members is lack of information about the removed element from a source list.  That's actually one of the reasons that I asked last week about status on getting that issue nailed down (this would also impact the ability to construct 'live' multi-maps where the returned elements for a given key is an EventList).
 
- K
 
----------------------- Original Message -----------------------
  
From: philk phil.kursawe@...
Cc: 
Date: Mon, 13 Jul 2009 03:15:07 -0700 (PDT)
Subject: Displaying users that are in a certain area of a building: GroupingList or Filters?
  

Hello,

my current problem is that I need to display which user is currently in what
area.

class Area {
 String id;
 String name;
}

class User {
 Area area;
}

A user can be in no area at all, then its area is null.

I want to have a view of all available areas and for each area a
EventTableViewer with all the users of this area in it. I though of using a
GroupingList but having trouble updating it when a user is switching areas.

Also the areas themself are highly dynamic, there can be areas added or
removed during runtime.

I thought of having an EventList<Area> with all the areas that exist. Then,
when this list changes, I would remove/create EventTableViewer for each area
and now I need to fill in the users in each table viewer. I could filter
each table viewer with its respective Area, if that is the preferred way? Or
should I use a GroupingList for the users area? However GroupingList does
not provide Support for EventList on its get(int) method. So I would have to
wrap it somehow?

Thanks for any input,
Phil
--
View this message in context: http://www.nabble.com/Displaying-users-that-are-in-a-certain-area-of-a-building%3A-GroupingList-or-Filters--tp24459041p24459041.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...

Re: re: Displaying users that are in a certain area of a building: GroupingList or Filters?

by philk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah Kevin, I have implemented it using filters but have run into a concurrency problem with the base source list that is displayed in different viewers now. It somehow gets locked in the wrong way. See my other post of today for further informations.

We will see what the GL people have to say about this,
thanks,
Phil

Re: Displaying users that are in a certain area of a building: GroupingList or Filters?

by Witold Szczerba :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/7/13 philk <phil.kursawe@...>:

>
> Hello,
>
> my current problem is that I need to display which user is currently in what
> area.
>
> class Area {
>  String id;
>  String name;
> }
>
> class User {
>  Area area;
> }
>
> A user can be in no area at all, then its area is null.
>
> I want to have a view of all available areas and for each area a
> EventTableViewer with all the users of this area in it. I though of using a
> GroupingList but having trouble updating it when a user is switching areas.

Hi there,
I must admit I know nothing about SWT, but... maybe it is not much
different than Swing's TableModel? If so, maybe it would be easier to
create the model instead of poking arounf EventLists? In Swing all one
has to do is to subclass AbstractTableModel and implement methods like
getValue(column,row). That is really easy to create such a
combinations like: list of users, list of whatever and list (hash set
maybe better) of associations users:whatever. Now it is up to you to
filter out or 'un-check' users which do not belong to given group in
given model. And easy to implement setValue(row,column) which
produces/removed associations.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...