Hi,
I need to always show the maximize, minimize, externalize or close buttons in the mini panel instead on adding them to a menu
For example, you can launch the below example and click on the button in the red panel, after several add you’ll notice that the buttons of the stacked station will disappear and a small menu arrow is shown instead
Could you please advice?
public class Example6 {
private CControl control;
private int counter;
public Example6() {
JFrame frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
control = new CControl(frame);
control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
CContentArea contentArea = control.createContentArea("root_gris_area");
frame.getContentPane().add(contentArea, BorderLayout.CENTER);
frame.setLayout(new GridLayout(1, 1));
final CWorkingArea workingArea = control.createWorkingArea("root_working_area");
JPanel panel = new JPanel();
panel.setOpaque(true);
panel.setBackground(Color.RED);
JButton addButton = new JButton("Add to Stack");
panel.add(addButton);
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DefaultSingleCDockable stackeddockable = create("gray" + counter++, Color.GRAY);
workingArea.add(stackeddockable);
stackeddockable.setVisible(true);
}
});
DefaultSingleCDockable red = new DefaultSingleCDockable("Red", "Red", panel);
control.addDockable(red);
DefaultSingleCDockable green = create("Green", Color.GREEN);
control.addDockable(green);
DefaultSingleCDockable gray1 = create("gray" + counter++, Color.GRAY);
workingArea.add(gray1);
gray1.setVisible(true);
DefaultSingleCDockable gray2 = create("gray" + counter++, Color.GRAY);
workingArea.add(gray2);
gray2.setVisible(true);
CGrid grid = new CGrid();
grid.add(0, 0, 0.7, 1.5, red);
grid.add(1, 0, 1.5, 1.5, green);
grid.add(1, 1, 2.5, 1, workingArea);
contentArea.deploy(grid);
frame.setSize(new Dimension(500, 500));
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new Example6();
}
private DefaultSingleCDockable create(String title, Color color) {
JPanel panel = new JPanel();
panel.setOpaque(true);
panel.setBackground(color);
return new DefaultSingleCDockable(title, title, panel);
}
}
Regards,