Results 1 to 7 of 7

Thread: Creating a docking panel using VLDocking

  1. #1

    Default Creating a docking panel using VLDocking

    Hi list!

    I'm trying to create a UI very similar with the Eclipse or Netbeans workspace: one JTree at the left side with items, and a main panel where the views are organized using tabbed panels.

    To implement something like that, using the VLDocking API I must write:

    Code:
    DockingDesktop desk = new DockingDesktop();
    desk.split(treePanel, contentPanel, DockingConstants.SPLIT_LEFT);
    How can I do that using the spring-richclient-vldocking module? The VLDockingLayoutManager default implementation has only the following way of adding components:

    Code:
    public void addDockable(DockingDesktop desktop, Dockable dockable) {
             desktop.addDockable(dockable);
    }
    In another words, there isn't a declarative way of adding components using the split() method, right?

    Did anyone try something similar?

    Thanks in advance! (and sorry my poor english...)

  2. #2
    Join Date
    Feb 2006
    Posts
    118

    Default

    The idea of the VLDockingLayoutManager is that you provide your own implementation that knows how to lay out the various Views that are added.

    Whether your custom layout manager is configured declaratively or otherwise is up to you.

    I guess it would be helpful to provide a default implementation that looks for a declared location for each view, and falls back to the current behaviour. If you get around to doing this, please do consider contributing it to the project.

  3. #3

    Default

    Thanks Rogan!

    I'm very new to Spring RCP, and new to Spring Framework in general, in case I find the path to solution, I will be very happy to contribute it.

    What you think about this: I'm planning to extend the VLDockingPageDescriptor, adding 2 fields: the base view and a relative position. And then I will implement a VLDockingLayoutManager which will use this 2 informations to layout the desktop. Make sense? Too stupid or naive?

    Thanks for your answer, your time and the tips!

  4. #4
    Join Date
    Feb 2006
    Posts
    118

    Default

    That sounds reasonable, in certain circumstances.

    Particularly, it assumes that your base view is always available, which is not always going to be true in the general case.

    One thing that is missing in the current VLDocking implementation is the ability to specify "docking areas". i.e. places to dock Views, but that don't actually get rendered themselves.

    This would be analogous to Netbeans with no Java source files open, for example. Then you *would* be able to assume that the "docking area" is always there.

  5. #5

    Default

    Ah! Ok, if I understood well, something like to define constants NORTH, SOUTH, EAST, WEST, CENTER, and then use this information to put the window in the right place. If two windows are in the same region, add them using tabs.

    I will try, thanks again!

  6. #6
    Join Date
    Feb 2006
    Posts
    118

    Default

    Right. That would work as a simple implementation, too.

    I'm not sure if the VLDocking API allows you to determine if one of the existing Views is docked as "NORTH", unfortunately. I suspect that you will just be able to get a size and location, and will have to figure out if that equates to NORTH yourself. You have to know if there is something else in the same position if you want VLDocking to add it as a tab in the same place, since you have to pass the name of an existing dockable to "tab with".

    Good luck!

  7. #7

    Default

    Hi fbdo,

    I did something similiar to the Eclipse-UI, maybe you want to try it out:
    http://toubsen.de/spring-rcp/vl-docking-history

    It just takes up the whole application screen for one page, but maybe you get some hints on how to hook into the docking system.

    Kind regards,
    t0asti

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •