r21468@martha (orig r829): castaway | 2008-08-16 15:35:45 -0400
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / ListView.pm
1 package Reaction::UI::ViewPort::ListView;
2
3 use Reaction::Class;
4 use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member::WithActions';
5
6 use namespace::clean -except => [ qw(meta) ];
7 extends 'Reaction::UI::ViewPort::Collection::Grid';
8
9 with 'Reaction::UI::ViewPort::Collection::Role::Order';
10 with 'Reaction::UI::ViewPort::Collection::Role::Pager';
11 with 'Reaction::UI::ViewPort::Role::Actions';
12
13 #If I decide that object actions and collection actions should be
14 #lumped together i oculd move these into the collection action role
15 #ooor we could create a third role that does this, but gah, no?
16 sub _build_member_class { WithActions };
17
18 #You'se has to goes aways. sorry.
19 #if i saved the args as an attribute i could probably get around this....
20 sub object_action_count {
21   my $self = shift;
22   for ( @{ $self->members } ) {
23     #pickup here, and of to the widget for listview
24     return scalar @{ $_->action_prototypes };
25   }
26 };
27
28 __PACKAGE__->meta->make_immutable;
29
30
31 1;