*/
	private void remove(TabbedDockableContainer tdc) {

		// TODO : check this : split this method in two (removeImpl() should be
		// used form inside the framework, and
		// remove should trigger CLOSE state change events
		Dockable firstDockable = tdc.getDockableAt(0);
		// if (dockingPanel.isAncestorOf(dockable.getComponent())){ //2005/10/06
		// ...
		DockableState.Location dockLocation = firstDockable.getDockKey()
				.getLocation();

		if (dockLocation == DockableState.Location.FLOATING) {
			FloatingDockableContainer fdc = (FloatingDockableContainer) SwingUtilities
					.getWindowAncestor((Container) tdc);
			DockingUtilities.dispose(fdc);
			// ((JDialog)dlg).dispose();
		}

		boolean invalidateDesktop = true; // always, except for floating
											// dockables

		Component parent = ((Component) tdc).getParent();

		if (parent != null) {
			if (parent instanceof SplitContainer) {
				SplitContainer viewParent = (SplitContainer) parent;
				if (viewParent.getLeftComponent() == tdc) {
					viewParent.remove((Component) tdc);
					Component other = viewParent.getRightComponent();
					// replace viewParent by other in viewParent's hierarchy
					Container viewGParent = (Container) viewParent.getParent();
					DockingUtilities.replaceChild(viewGParent, viewParent,
							other);
				} else {
					viewParent.remove((Component) tdc);
					Component other = viewParent.getLeftComponent();
					Container viewGParent = (Container) viewParent.getParent();
					DockingUtilities.replaceChild(viewGParent, viewParent,
							other);
				}
			} else if (parent == dockingPanel) { // no more views to show
				dockingPanel.remove(0);
			} else if (SwingUtilities.getWindowAncestor(parent) instanceof FloatingDockableContainer) {
				// removing from a FloatingDockableContainer... nothing to do
				invalidateDesktop = false;
			} else {
				throw new IllegalStateException(
						"View is not contained in desktop hierarchy " + parent);
			}

			if (invalidateDesktop) {
				dockingPanel.invalidate();
				dockingPanel.validate();
				dockingPanel.repaint();
			}
		}