Get focused Dockable

how can i get a focused Dockable ?

nobady knows ? its very important ! tried to get the current dockable by controller but it doesnt work :frowning:

Sure somebody knows, this somebody just is not available 24/7 :wink:

In Common you cannot directly get the focused Dockable, but you can add a „CFocusListener“ to the „CControl“ (CControl.addFocusListener), this listener will be informed every time when the focus changes.

Starting with version 1.1.1p6a you can use the method CControl.getFocusedCDockable, which returns the currently focused CDockable. Version 1.1.1p6a is not yet available, but should be online within the next 24 hours.

You can also use „DockController.getFocusedDockable“, which returns a Dockable. If you are using Common, then you might need to cast this dockable:

Dockable dockable = control.getController().getFocusedDockable();
if( dockable instanceof CommonDockable ){
  CDockable cdockable = ((CommonDockable)dockable).getDockable();
}```