NAME
Class::Declarative::Node - implements a node in a declarative structure.
VERSION
Version 0.01
SYNOPSIS
Each node in a Class::Declarative
structure is represented by one of these objects. Specific semantics subclass these nodes for each of their components.
defines()
Called by Wx::DefinedUI during import, to find out what xmlapi tags this plugin claims to implement. This is a class method, and by default we've got nothing.
new()
After creating the XML::xmlapi node, our local new
has to create a null payload.
payload()
Returns our payload (the underlying object in whatever system we're providing a framework for).
build(), build_payload(), add_to_parent()
The build
function builds the payload we define, then builds all its children, then adds itself to its parent. It provides two hooks, build_payload
and add_to_parent
, that can be overridden by semantic classes. The defaults do nothing.
describe
The describe
function is used to get our code back out so we can reparse it later if we want to.
go($item)
For callable nodes, this is one way to call them. The default is to call the go methods of all the children of the node, in sequence.
closure(...)
For callable nodes, this is the other way to call them; it returns the closure created during initialization. Note that the default closure is really boring.
body()
Extracts the body text of this node, if any.
event_context
If the node is an event context (e.g. a window or frame or dialog), this should return the payload of the node. Otherwise, it returns the event_context of the parent node.
root
Returns the parent - all nodes do this. The top node at Class::Declarative
returns itself.
AUTHOR
Michael Roberts, <michael at vivtek.com>
BUGS
Please report any bugs or feature requests to bug-wx-definedui at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wx-DefinedUI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
LICENSE AND COPYRIGHT
Copyright 2010 Michael Roberts.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.