How BoldTreeView works

This is just a quick set of instructions rather than a comprehensive article.  It is a copy of a posting I made in a Borland newsgroup...

I'll give you an example of one I did recently....

01) Set the BoldHandle property to your BoldSystemHandle
02) Double-click the treeview to bring up the editor
03) Click the "Root" element
04) If it hasn't already got a child, click "Add List Fragment"
05) In ElementExpression enter the main OCL, for example
06) Set InterpretAsList to True
07) Set ControllerExpression to 'Customer' (including quotes)

What you have now is a root that grabs a list of Customers.  The BTV knows that it needs a "node controller" called "Customer" to represent each item in the list (which is why InterpretAsList = True).

08) Click "Add Node Description"
09) Set the Name property to "Customer"  (This is how Bold finds the correct controller!)

10) In TextController.Expression you can set the display value for the node, eg "name"
11) Click "Add List Fragment"

Adding a list fragment will define what sub-nodes a Customer will have.
These sub-nodes can also be Customer objects, in which case you get a
potentially endless structure

12) In ElementExpression enter (this is not a realistic example)
13) In ControllerExpression enter 'Customer'

==Read only once you are familiar with the above==

The controller expression is in quotes because it is an OCL expression.  So
you can easily tell Bold to determine the controller name at runtime.  For
example, if you wanted a different controller for each descendant class
within an association you could use this expression
    oclType.typename + '_Controller'
and then name your node Descriptions "Customer_Controller",
"SpecialCustomer_Controller", etc.


Share this article!

Follow us!

Find more helpful articles: