NAME
Tree::Simple::View::Base - An abstract base class for viewing Tree::Simple heirarchies
SYNOPSIS
use Tree::Simple::View::Base;
DESCRIPTION
This is an abstract base class for the Tree::Simple::View::* classes. It sets up some of the common elements shared between the classes, and defines the base interface. This documentation will detail the code implemented within this pacakge, which will also be duplicated in the implementing classes as neseccary. So in reality this documentation serves little purpose.
METHODS
- new ($tree, %configuration)
-
Accepts a
$treeargument of a Tree::Simple object (or one derived from Tree::Simple). This$treeobject does not need to be a ROOT, you can start at any level of the tree you desire. The options in the%configargument are determined by the implementing subclass, and you should refer to that documentation for details. - expandPath (@path)
-
This method will return a string which will represent your tree expanded along the given
@path. This is best shown visually. Given this tree:Tree-Simple-View lib Tree Simple View.pm View Base.pm HTML.pm DHTML.pm Makefile.PL MANIFEST README Changes t 10_Tree_Simple_View_test.t 20_Tree_Simple_View_HTML_test.t 30_Tree_Simple_View_DHTML_test.tAnd given this path:
Tree-Simple-View, lib, Tree, SimpleYour display would like something like this:
Tree-Simple-View lib Tree Simple View.pm View Makefile.PL MANIFEST README Changes tAs you can see, the given path has been expanded, but no other sub-trees are shown. The details of this are subject to the implementating subclass, and their documentation should be consulted.
It should be noted that this method actually calls either the
expandPathSimpleorexpandPathComplexmethod depending upon the%configargument in the constructor. - expandPathSimple ($tree, @path)
-
If no
%configargument is given in the constructor, then this method is called byexpandPath. This method is optimized since it does not need to process any configuration, but just as the name implies, it's output is simple.This method can also be used for another purpose, which is to bypass a previously specified configuration and use the base "simple" configuration instead.
- expandPathComplex ($tree, $config, @path)
-
If a
%configargument is given in the constructor, then this method is called byexpandPath. This method has been optimized to be used with configurations, and will actually custom compile code (usingeval) to speed up the generation of the output.This method can also be used for another purpose, which is to bypass a previously specified configuration and use the configuration specified (as a HASH reference) in the
$configparameter. - expandAll
-
This method will return a string of HTML which will represent your tree completely expanded. The details of this are subject to the implementating subclass, and their documentation should be consulted.
It should be noted that this method actually calls either the
expandAllSimpleorexpandAllComplexmethod depending upon the%configargument in the constructor. - expandAllSimple
-
If no
%configargument is given in the constructor, then this method is called byexpandAll. This method too is optimized since it does not need to process any configuration.This method as well can also be used to bypass a previously specified configuration and use the base "simple" configuration instead.
- expandAllComplex ($config)
-
If a
%configargument is given in the constructor, then this method is called byexpandAll. This method too has been optimized to be used with configurations, and will also custom compile code (usingeval) to speed up the generation of the output.Just as with
expandPathComplex, this method can be to bypass a previously specified configuration and use the configuration specified (as a HASH reference) in the$configparameter.
BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
SEE ALSO
This is just an abstract base class, I suggest you read the documentation in the implementing subclasses:
AUTHOR
stevan little, <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2004 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.