Dynamically adding a SingleCDockable to a stack


i would like to add a SingleCDockable at runtime. Is there a method to do that?

This is want i’m doing at the moment, but i think its not good:

public void addServiceToTab(String name, SingleCDockable dock){
        IFView diagService = new DiagnosticServiceView(controller, model);
        dock = createDockable(name ,diagService);
        grid.add(30, 10, 80, 80, dock);

CControl.addDockable will register the Dockable, „setVisible“ will make it visible. You can use „setLocation“ to set the location, preferrably before making the item visible :wink:

SingleCDockable dockable = ...

control.addDockable( dockable );
dockable.setLocation( information.getBaseLocation().aside() );
dockable.setVisible( true );

Thx that worked for me :slight_smile: