system
July 22, 2009, 5:24am
1
Hi,
What I want to achieve is, when i click on a button, a tab (a dockable) gets added in workingarea. That dockable will have a close button, when close is clicked that dockable gets destroyed.
Is there a straight forward way to achieve this?
Maybe a setting or something.
Thanks
system
July 22, 2009, 5:26am
2
Currently, when we close, that tab( dockable) just gets hidden and not destroyed.
Beni
July 22, 2009, 11:08pm
3
Add a CControlListener to the CControl, its “closed”-method should be called every time when a dockable is closed.
Currently there is no listener that could be added to a CDockable and give this information.
system
July 23, 2009, 12:03am
4
[QUOTE=Beni]
Currently there is no listener that could be added to a CDockable and give this information.[/QUOTE]
I did a workaround for it, not sure if it is right way to do it.
private class Test implements CCloseAction{
private CControl maincontrol;
public Test( CControl control ){
super( control );
maincontrol = control;
}
@Override
public void close( CDockable dockable ){
super.close( dockable );
System.out.println( "close triggered" );
maincontrol.remove((SingleCDockable) dockable);
}
}
...
dockable.putAction( CDockable.ACTION_KEY_CLOSE, new Test( control ) );
...
Beni
July 23, 2009, 12:59am
5
As long as you don’t offer any other way to close the dockable, that should work.