The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::ZFSCurses::WidgetFactory - a factory to create widgets.

METHODS

VERSION

Version 1.02.

new

Create an instance of App::ZFSCurses::WidgetFactory.

search_value

Search a value in an array. Return the value index if found. Return -1 if not found.

widget_selector

Select the right widget to create. This method expects a property list as first argument. It will then check for its type, create the widget accordingly and return it.

make_widget

Make a widget depending on the property type. This method expects a property and, sometimes, the current value (selected in the UI). This method is called from the UI module when a user selects a property and wants to change it.

set_container

Set the container that will contain the created widget.

fill_property_hash

Read the DATA handle and fill the property hash. __DATA__ contains a list of key value pairs that represent a property and its possible values. Note: the ALNUM value means the property is alphanumerical and a textfield has to be created to be shown to the user. Otherwise, a radio button box is created with the possible values. See the widget_selector function.

properties

Return the properties hash.

is_property_ro

Check whether a property is read only (cannot be changed).

AUTHOR

Patrice Clement <monsieurp at cpan.org>

LICENSE AND COPYRIGHT

This software is copyright (c) 2020 by Patrice Clement.

This is free software, licensed under the (three-clause) clause BSD License.

See the LICENSE file.