Two-pane browser

2 views
Skip to first unread message

Ralph Johnson

unread,
Apr 2, 2009, 10:33:32 PM4/2/09
to OmniBrowser Development
I have some students who want to build a browser with only two panes.
The pane on the left would be a tree-view that displays the package/
class/protocol/method selected, while the pane on the right would be a
code view.

Does anybody have hints about how we would go about this? I recall
seeing a tree-view in omnibrowser a few weeks back, but can't find it
now. Would we make some node classes?

Suppose we made a new class of panes. How would we tell that browser
that we wanted to use it?

-Ralph Johnson

David Röthlisberger

unread,
Apr 4, 2009, 6:18:54 PM4/4/09
to omnibro...@googlegroups.com
Hi Ralph,

> I have some students who want to build a browser with only two panes.
> The pane on the left would be a tree-view that displays the package/
> class/protocol/method selected, while the pane on the right would be a
> code view.
>
> Does anybody have hints about how we would go about this? I recall
> seeing a tree-view in omnibrowser a few weeks back, but can't find it
> now.

In the package OB-Enhancements there is an OBTreeColumn, using OBPluggableTreeMorph
and OBPluggableTreeItemWithParentNode. By default, this tree shows packages as root
elements and class cats as children, but it could also show the whole code hierarchy
down to methods.
You can specify in the metamodel which transitions should be navigated in the tree.
I suggest to look at OBPackageBrowser class >> defaultMetaNode

> Suppose we made a new class of panes. How would we tell that browser
> that we wanted to use it?

The two panes could be modelled using an OBColumnPanel. As a first column, you pass
the tree, as a second the definition panel.
Each browser (OBSystemBrowser, OBPackageBrowse, etc.) has on the class side a method
#panels defining the panels it shows.
In your example you'd just use a single panel, let's call it navigation panel, which
is an instance of the column panel class you implement, ie. a subclass of OBColumnPanel.
Eventually you probably just need to implement your own browser and column panel
class. The other main components you can base on existing classes.

Cheers,
David

hyungsul

unread,
Apr 14, 2009, 3:30:03 PM4/14/09
to OmniBrowser Development
> The two panes could be modelled using an OBColumnPanel. As a first column, you pass
> the tree, as a second the definition panel.

I am trying to put a OBTreeColumn and DefinitionPanel together in one
panel, but because OBDefinitionPanel is not a subclass of OBColumn I
could not add it to a column panel.

Best,
HyungSul

Colin Putney

unread,
Apr 15, 2009, 2:38:12 AM4/15/09
to omnibro...@googlegroups.com

Probably a better option would be to have a horizontal panel group
containing an OBColumnPanel on the left and your definition panel on the
right. In your browser class, override #panels (class side) to answer
column panel and definition panel. On the instance side, override
#buildOn: with something like this:

buildOn: aBuilder
^ aBuilder window: self with:
[aBuilder horizontalGroupWith:
[panels do: [:each | each buildOn: aBuilder]]]

HTH,

Colin

Lukas Renggli

unread,
Apr 15, 2009, 2:52:32 AM4/15/09
to omnibro...@googlegroups.com
> Probably a better option would be to have a horizontal panel group
> containing an OBColumnPanel on the left and your definition panel on the
> right. In your browser class, override #panels (class side) to answer
> column panel and definition panel. On the instance side, override
> #buildOn: with something like this:
>
> buildOn: aBuilder
>     ^ aBuilder window: self with:
>         [aBuilder horizontalGroupWith:
>             [panels do: [:each | each buildOn: aBuilder]]]

The OmniBrowser inspector does exactly that, if you want to have a
look at a running example.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

hyungsul

unread,
Apr 20, 2009, 2:44:00 PM4/20/09
to OmniBrowser Development
Thank you, Colin and Lukas.

We are getting closer to the goal. However, there is a problem in
OBTreeColumn.
If we use a OBTreeColumn, we get an error when we click a text in the
OBTreeColumn.
We think that the error is due to the code, enforcing a metanode has
at least one non-tree-meta-edge.
However, in our two-column browser(one is for tree view, another one
is for code view), we do not have a meta-edge other than tree-meta-
edge.
Again, thanks for your responses.

For Lukas: I cannot find OmniBrowser-based Inspector in my image.
Which class do you mean?

-hyungsul

Damien Cassou

unread,
Apr 21, 2009, 5:57:05 AM4/21/09
to omnibro...@googlegroups.com
On Mon, Apr 20, 2009 at 8:44 PM, hyungsul <HyungS...@gmail.com> wrote:
> For Lukas: I cannot find OmniBrowser-based Inspector in my image.
> Which class do you mean?

Load OB-Tools from http://source.lukas-renggli.ch/omnibrowser/. The
class is named OTInspector IIRC

--
Damien Cassou
http://damiencassou.seasidehosting.st

Reply all
Reply to author
Forward
0 new messages