r21159@ares (orig r846): edenc | 2008-08-18 16:41:52 -0300
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Action.pm
CommitLineData
2f670e13 1package Reaction::UI::Widget::Action;
9de685fc 2
3use Reaction::UI::WidgetClass;
4
bae75bee 5use namespace::clean -except => [ qw(meta) ];
6extends 'Reaction::UI::Widget::Object';
9de685fc 7
bae75bee 8
9
10after fragment widget {
11 arg 'method' => $_{viewport}->method;
12};
13
14implements fragment ok_button_fragment {
15 if (grep { $_ eq 'ok' } $_{viewport}->accept_events) {
16 arg 'event_id' => event_id 'ok';
17 arg 'label' => $_{viewport}->ok_label;
18 render 'ok_button';
19 }
20};
21
22implements fragment apply_button_fragment {
23 if (grep { $_ eq 'apply' } $_{viewport}->accept_events) {
24 arg 'event_id' => event_id 'apply';
25 arg 'label' => $_{viewport}->apply_label;
26 render 'apply_button';
27 }
28};
29
30implements fragment cancel_button_fragment {
31 if (grep { $_ eq 'close' } $_{viewport}->accept_events) {
32 arg 'event_id' => event_id 'close';
33 arg 'label' => $_{viewport}->close_label;
34 render 'cancel_button';
35 }
9de685fc 36};
37
bae75bee 38__PACKAGE__->meta->make_immutable;
39
40
9de685fc 411;
42
43__END__;
44
5a1a893e 45=head1 NAME
9de685fc 46
2f670e13 47Reaction::UI::Widget::Action
9de685fc 48
5a1a893e 49=head1 DESCRIPTION
9de685fc 50
5a1a893e 51=head1 FRAGMENTS
9de685fc 52
cc44a337 53=head2 ok_button_fragment
5a1a893e 54
cc44a337 55=head2 apply_button_fragment
5a1a893e 56
cc44a337 57=head2 cancel_button_fragment
5a1a893e 58
59=head1 AUTHORS
60
61See L<Reaction::Class> for authors.
62
63=head1 LICENSE
64
65See L<Reaction::Class> for the license.
9de685fc 66
67=cut
5a1a893e 68