if (removeAll) {
panel.removeAll();
}
panel.add(titleLabel, BorderLayout.WEST);
if (additionalComponents != null && additionalComponents.length > 0) {
BoxBuilder row = BoxBuilder.horizontal();
row.addAllWithSpace(10, additionalComponents);
row.setOpaque(false);
row.glue();
panel.add(row.container(), BorderLayout.CENTER);
} else {
panel.add(Box.createHorizontalGlue(), BorderLayout.CENTER);
}
if (toolBars != null) {
BoxBuilder row = BoxBuilder.horizontal().setOpaque(false);
row.addAllWithSpace(5, toolBars);
row.addToParent(panel, BorderLayout.EAST);
}
}