Visual Works Class Hierarchy Browser How To

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Visual Works Class Hierarchy Browser How To

Diego Diego
Hi!
I'm doing an assignment in a class at university, which consists on implementing
traits in VisualWorks. I have to developed visual tools to work with them, so I decided I want to modify the Class Hierarchy Browser, so for example, the user will be able to check on a "Show Traits" radio button, and instead of showing the classes of the system, the Browser will show the traits of the system to be able to edit them and manipulate them with the same tools we use with classes.
My problem is that I don't know exactly where or how to implement this functionality on the Class Hierarchy Browser (For example, I would need to modify the message send that asks the system for the classes, and ask for the traits instead if the proper radio button is selected).

Does anyone know in which class/method or where is the code that handles this functionality?

Thanks you very much,
Diego
Reply | Threaded
Open this post in threaded view
|

Re: Visual Works Class Hierarchy Browser How To

Niall Ross
Dear Diego,
    you may want to modify the RB rather than the very old
ClassHierarchy browser (which may well be discarded in future versions
of VW).

In the 7.5 VW RB, methods fillInState: and updateWithState: in
subclasses of NavigatorPart control how selection in one pane prompts
display in panes to its right.  You will also want to look at
fillInListFor: called within fillInState: by specific NavigatorParts.

A navigator holds an 'environment' (BrowserEnvironment subclass - empty
printString means its the whole environment) of what code it is viewing,
and instVars 'parts' and 'partsDictionary' of its NavigatorPart subclass
instances.  TabNavigatorPart subclasses provide subparts (held in their
'namedComponents' instVar) and tabs to build and switch between
different subpart arrangements.

 - NameSpaceItemTabNavigatorPart displays the contents of an item (such
as a class) that can be in a namespace.  Its instVar 'type' holds
#instance or #class or #sharedVariable, with #instance mapping to either
protocol and instance-side method display, or instance variable and
referencing instance-side method display.  Methods build*SubCanvas
construct these views.

 - CodeComponentTabNavigatorPart display a pundle, parcel or category
list with the classes and other namespace items in that list, with tabs
to show either the list and classes, or a class hierarchy.  
CodeComponentTabNavigatorPart>>defaultTabDescriptions sets up the tab
list;  it shows the match (i.e. visibility) and enablement settings for
each tab, and the build* code each calls when selected.

You could add one or more tabs for trait display.  The package / parcel
(and/or category if you wanted) tabs could just be reused.  A subclass
or variant of ClassNavigatorPart and/or its subclass(es) could display
the names of traits, while a NameSpaceItemTabNavigatorPart subclass or
variant could display trait contents.

Provided you are careful to isolate all your new behaviour behind tabs,
the RB should keep working fine on standard tabs as you experiment and
develop these variants.  Ideally you should be able to slim down the new
behaviour to the most minimal subclasses and subclass-overriding of methods.

HTH.
          Yours faithfully
             Niall Ross

> Hi!
> I'm doing an assignment in a class at university, which consists on
> implementing
> traits in VisualWorks. I have to developed visual tools to work with
> them, so I decided I want to modify the Class Hierarchy Browser, so
> for example, the user will be able to check on a "Show Traits" radio
> button, and instead of showing the classes of the system, the Browser
> will show the traits of the system to be able to edit them and
> manipulate them with the same tools we use with classes.
> My problem is that I don't know exactly where or how to implement this
> functionality on the Class Hierarchy Browser (For example, I would
> need to modify the message send that asks the system for the classes,
> and ask for the traits instead if the proper radio button is selected).
>
> Does anyone know in which class/method or where is the code that
> handles this functionality?
>
> Thanks you very much,
> Diego