Simple docking question

I have a question about how to dock a dockable in the desired position.

Imagine i have the following situation. I have two dockables already docked (see the attached screenshot), and now i want to add another dockable. But i want to dock it onto the green dockable, so that another tab is added and i can switch between those two panels.
I tried a lot with locations, but none of them worked the way i want.
The above seen layout is created this way:

AbstractView view = m_registeredViews.get(View1.ID).getView(this);
view.setLocation(CLocation.base().normal());
m_dockControl.add((SingleCDockable)view);
view.setVisible(true);
AbstractView view = m_registeredViews.get(View2.ID).getView(this);
view.setLocation(CLocation.base().normalWest(0.25));
m_dockControl.add((SingleCDockable)view);
view.setVisible(true);
...
  1. Is it possible to dock another view directly onto View1? How can i do this?
  2. Is it possible to do that without having to get a reference to the desired view? For example if i dock a view with
    setLocation(CLocation.base().normal())
    is it possible to dock another view directly onto it with the same command?

Thanks very much for any help.
Greetings, -chris-

If you have the CLocation of the other dockable, then there is a method “CLocation#aside” which will create a location pointing to the next tab.

Otherwise adding a call “CLocation#stack(1)” also can serve as hint to create a tab. But you have to create a location that matches the location of your other dockable first.

Unfortunatelly the placeholder mechanism can not yet be used for placing the dockables.

[edit: if you need an example I’ll write one]

Hi Beni,
thanks for you reply but it seems i didn’t understand the concept of locations.
At first i thought, giving a location like CLocation.base.normal() is an absolute positioning. But now i guess it’s not.
My second problem is, where do i get the location of a dockable. Calling getBaseLocation() always returns a null for me, even if i called setLocation() on that dockable before.
So it would be very nice if you can provide me a small example.

-chris-