- Let me try to explain why you run into problems:
While the case with one tab and the case with many tabs look similar, they are handled differently by the framework:
Using the picture you uploaded: “Single Dockables” and “Multiple Dockables” are direct children of the SplitDockStation in the middle of the frame. The other two dockables are children of a StackDockStation, which in return is a child of the SplitDockStation.
The SplitDockStation uses for each child a “DockableDisplayer”, in this case an “EclipseDockableDisplayer”, to paint decorations like a border and a tab.
The StackDockStation, in the upper half of the image, uses a “StackDockComponent” (in this case a “EclipseTabPane”) to paint a line of tabs and for each child a displayer to paint the border.
Most likely you only replaced the “StackDockComponent”, but not the displayers.
- Now the solution I would use (requires the newest version of the framework): The EclipseTabPaneContent uses a TabPanePainter to paint foreground and background, it is possible to replace this painter. The TabPanePainter is created by a factory called “TabPainter”, this factory is stored in the properties.
First create a new TabPanePainter by subclassing LinePainter and overriding “paintBackground”
private EclipseTabPane pane;
public BackgroundPainter( EclipseTabPane pane ){
super( pane );
this.pane = pane;
}
@Override
public void paintBackground( Graphics g ){
g.setColor( Color.RED );
JComponent parent = pane.getComponent();
g.fillRect( 0, 0, parent.getWidth(), parent.getHeight() );
}
}```
Then create a new factory. TabPainter has several methods, just use an existing factory to fill most of them:
```public class BackgroundTabPainter implements TabPainter{
private TabPainter delegate = ArchGradientPainter.FACTORY;
public TabPanePainter createDecorationPainter( EclipseTabPane pane ){
return new BackgroundPainter( pane );
}
public InvisibleTab createInvisibleTab( InvisibleTabPane pane, Dockable dockable ){
return delegate.createInvisibleTab( pane, dockable );
}
public TabComponent createTabComponent( EclipseTabPane pane, Dockable dockable ){
return delegate.createTabComponent( pane, dockable );
}
public Border getFullBorder( BorderedComponent owner, DockController controller, Dockable dockable ){
return delegate.getFullBorder( owner, controller, dockable );
}
}```
And finally you have to plug-in the new factory:
```CControl control = ...
control.putProperty(EclipseTheme.TAB_PAINTER, new BackgroundTabPainter() );
[Edit: there will be gray lines between the Dockables. I think modifying the LookAndFeel itself, such that JPanels and JComponent are painted with some other background color, is the easiest solution to get rid of them]