How to rotate the title bar of a DefaultSingleCDockable

Hi all,
is it possible to rotate the title bar of a DefaultSingleCDockable?
In particular, I would need it set at the left-side of the dockable and vertically oriented.

It appears that setOrientation(DockTitle.Orientation.FREE_VERTICAL) applied to a CustomTitle extending AbstractDockTitle has no effect.

Thank you.

*** Edit ***

Hi all,
is it possible to rotate the title bar of a DefaultSingleCDockable?
In particular, I would need it set at the left-side of the dockable and vertically oriented.

It appears that setOrientation(DockTitle.Orientation.FREE_VERTICAL) applied to a CustomTitle extending AbstractDockTitle has no effect.

Thank you.

*** Edit ***

Actually, I am able to rotate the title TEXT, but not the whole BAR.
Is is possible to do it?

Yes it is possible. The orientation of a title is defined by the parent Component of the title. For most titles this is a DockableDisplayer (which also paints the border around the Dockable). The setting is usually only used by DockThemes and therefore not really exposed to client code. With some digging you can however get to the setting:


import javax.swing.JFrame;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CGrid;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.common.intern.CDockable;
import bibliothek.gui.dock.displayer.DisplayerRequest;
import bibliothek.gui.dock.station.DisplayerFactory;
import bibliothek.gui.dock.station.DockableDisplayer;
import bibliothek.gui.dock.station.DockableDisplayer.Location;
import bibliothek.gui.dock.themes.DisplayerFactoryValue;
import bibliothek.gui.dock.util.UIBridge;
import bibliothek.gui.dock.util.UIValue;

public class Marcello {
	public static void main( String[] args ) {
		new Marcello();
	}

	private CControl control;

	public Marcello() {
		JFrame frame = new JFrame( "Test" );
		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

		control = new CControl( frame );
		frame.add( control.getContentArea() );

		control.getController().getThemeManager().setDisplayerFactoryBridge( DisplayerFactoryValue.KIND_DISPLAYER_FACTORY, new LeftSidedBridge() );

		CDockable a = new DefaultSingleCDockable( "a", "Aaaa" );
		CDockable b = new DefaultSingleCDockable( "b", "Bbbb" );
		CDockable c = new DefaultSingleCDockable( "c", "Cccc" );
		CGrid grid = new CGrid( control );
		grid.add( 0, 0, 2, 1, a );
		grid.add( 0, 1, 1, 1, b );
		grid.add( 1, 1, 1, 1, c );
		control.getContentArea().deploy( grid );

		frame.setBounds( 20, 20, 1000, 1000 );
		frame.setVisible( true );
	}

	private class LeftSidedBridge implements UIBridge<DisplayerFactory, UIValue<DisplayerFactory>> {
		@Override
		public void add( String id, UIValue<DisplayerFactory> uiValue ) {
			// ignore
		}

		@Override
		public void remove( String id, UIValue<DisplayerFactory> uiValue ) {
			// ignore	
		}

		@Override
		public void set( String id, DisplayerFactory value, UIValue<DisplayerFactory> uiValue ) {
			uiValue.set( new LeftSidedFactory( value ) );
		}
	}

	private class LeftSidedFactory implements DisplayerFactory {
		private DisplayerFactory factory;

		public LeftSidedFactory( DisplayerFactory factory ) {
			this.factory = factory;
		}

		@Override
		public void request( DisplayerRequest request ) {
			factory.request( request );
			DockableDisplayer displayer = request.getAnswer();
			if( displayer != null ){
				displayer.setTitleLocation( Location.LEFT );
			}
		}
	}
}