package [% package %];
=begin hackers
[% autogenerated_warning %]
=end hackers
=head1 NAME
VCP::UIMachines - State machines for user interface
=head1 SYNOPSIS
Called by VCP::UI
=head1 DESCRIPTION
The user interface module L<VCP::UI|VCP::UI> is a framework that bolts
the implementation of the user interface to a state machine representing
the user interface.
Each state in this state machine is a method.
=head1 METHOD
=over
=cut
use strict;
[%- FOR s = machine.states -%]
[%- SWITCH s.class_ids -%]
[%- CASE "entry_class" -%]
=item [% s.id %]
[% s.description | trim %]
Next state: [% s.arcs_from.to %]
=cut
sub [% s.id %] {
return '[% s.arcs_from.to %]';
}
[%- CASE "exit_class" -%]
=item [% s.id %]
[% s.description | trim %]
=cut
sub [% s.id %] {
return undef;
}
[%- CASE "prompt_class" -%]
=item [% s.id %]: [% s.name %]
[% s.description | trim %]
Valid answers:
[% FOR a = s.arcs_from -%]
[% a.description %][% IF a.event.api %] ([%- a.event.api -%])[% END %] => [% a.to %]
[% END %]
=cut
sub [% s.id %] {
my ( $ui ) = @_;
my $prompt = '[% s.name %]';
my @valid_anwsers = (
[% FOR a = s.arcs_from -%]
[ '[% a.description %]',
[%- IF a.event.api %] [% a.event.api -%],
[%- ELSE %] '[% a.description -%]',
[%- END %] '[% a.to -%]' ],
[% END -%]
);
my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers );
return $answer->[-1];
END_DESCRIPTION
}
[%- END -%]
[%- END -%]
=back
=head1 WARNING: AUTOGENERATED
This module is autogenerated in the pre-distribution build process, so
to change it, you need the master repository files in ui_machines/...,
not a CPAN/PPM/tarball/.zip/etc. distribution.
=head1 COPYRIGHT
Copyright 2003, Perforce Software, Inc. All Rights Reserved.
This module and the VCP package are licensed according to the terms given in
the file LICENSE accompanying this distribution, a copy of which is included in
L<vcp>.
=head1 AUTHOR
Barrie Slaymaker <barries@slaysys.com>
=cut
1;
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #20 | 5400 | Barrie Slaymaker |
- Misc. doc tweaks |
||
| #19 | 4064 | Barrie Slaymaker |
- RevML is no longer offered in the UI - Sources and dests are given an id in the UI - The .vcp file name defaulting now works |
||
| #18 | 3666 | Barrie Slaymaker | - vcp can now edit existing .vcp files, for VSS sources and revml dests | ||
| #17 | 3646 | Barrie Slaymaker | - Further UI improvements | ||
| #16 | 3643 | Barrie Slaymaker | - UI formatting cleanup | ||
| #15 | 3640 | Barrie Slaymaker |
- xmllint no longer require to build UI - UI now offers multiple choices where appropriate |
||
| #14 | 3567 | John Fetkovich |
- added the field UIManager in VCP::UI::Text.pm - added the fields UIImplementation and TersePrompts in UI.pm - removed Source and Dest fields in VCP::UI.pm - UI.pm now returns the result of running the UI implementation. - VCP::UI::Text->run return a list of (source, dest) all future UI implementations must do the same. - bin/vcp gets (source, dest) list from VCP::UI->run. - added --terse (or -t) command line option to vcp to remove verbose help from interactive UI. |
||
| #13 | 3501 | John Fetkovich | added ui_set_revml_repo_spec, and caller in the stml file | ||
| #12 | 3499 | John Fetkovich |
- implement recoverable and non-recoverable exceptions in arc handlers. A user may accept a value that generated a recoverable exception. Otherwise, the question will be re-asked. - changed exceptions text in ui_set_revml_repo_spec. |
||
| #11 | 3494 | John Fetkovich | default values in interactive ui partially implemented | ||
| #10 | 3492 | John Fetkovich |
interative ui question re-asked if exception generated when arc handlers are run. a single test case for source revml input file has been tested. |
||
| #9 | 3393 | John Fetkovich | bug fix for arcs with no guard | ||
| #8 | 3296 | Barrie Slaymaker | Pass $answer and $answer_record in to the arc handler sub | ||
| #7 | 3295 | Barrie Slaymaker | s/anwsers/answers/g | ||
| #6 | 3255 | Barrie Slaymaker |
Add in support for <arc> <handler>s. Requires latest StateML. See VCP-Source-p4.stml for an example. Calls VCP::Source::p4 in an unsupported way resulting in death. |
||
| #5 | 3244 | Barrie Slaymaker |
Integrate VCP::UI with bin/vcp. Type 'vcp' to run the UI. |
||
| #4 | 3242 | Barrie Slaymaker | Allow ' and " in prompt, but { and } must be balanced. | ||
| #3 | 3234 | Barrie Slaymaker | More updates, passes make ui now. | ||
| #2 | 3231 | Barrie Slaymaker | work on STML->source code conventions | ||
| #1 | 3229 | Barrie Slaymaker | Add more .stml files |