Tab doesn't get destroyed when closed

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

Currently, when we close, that tab( dockable) just gets hidden and not destroyed.

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.

[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 ) );
...


As long as you don’t offer any other way to close the dockable, that should work.