Hiding Dockables leads to confision of tabs

Hi,

I’ve encountered a problem using Common CGrid and Eclipse Theme.

Using version 1.0.7:
I group several dockables in a CGrid stack. If I then hide a dockable (setVisible = false), the following dockables get kind of mixed up, e.g. not the last tab, but the next-to-last one will be selected. The Contents of the last tab is wrong, as it shows the content of the next-to-last one. First after doing some actions (e.g. maximizing tab) the contents will be corrected.

In 1.0.8p2 it’s almost working. Here the last tab is marked selected (coloured) but the content of the next-to-last tab is shown. But after Switiching between the tabs everything works.

But maybe it’s not a bug but I’m doing the hiding wrong…

Thanks, Raphael

attached you find code to test the issue:


import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CGrid;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.common.layout.ThemeMap;

public class DockingTest {

    private CControl control;

    private CGrid grid;

    private JFrame frame;

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

    public DockingTest() {
        frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500, 500);
        frame.setLayout(new BorderLayout());
        control = new CControl(frame);
        control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
        grid = new CGrid(control);
        DefaultSingleCDockable dock1 = new DefaultSingleCDockable("T1", "T1",
                new JLabel("1"));
        grid.add(1, 0, 1, 1, dock1);
        DefaultSingleCDockable dock2 = new DefaultSingleCDockable("T2", "T2",
                new JLabel("2"));
        grid.add(1, 0, 1, 1, dock2);
        DefaultSingleCDockable dock3 = new DefaultSingleCDockable("T3", "T3",
                new JLabel("3"));
        grid.add(1, 0, 1, 1, dock3);
        control.getContentArea().deploy(grid);
        dock1.setVisible(false);
        frame.add(control.getContentArea(), BorderLayout.CENTER);    
        frame.setVisible(true);
    }
}

Uh, that is a bug of the framework.

Alright then, thanks!
Shall I make a bug report?

Not necessary, once I know of a bug I normally don’t forget it again.