RibbonTask selectedTask = ribbon.getSelectedTask();
// System.out.println(selectedTask.getTitle() + " min width");
for (AbstractRibbonBand ribbonBand : selectedTask.getBands()) {
int bandPrefHeight = ribbonBand.getMinimumSize().height;
Insets bandInsets = ribbonBand.getInsets();
RibbonBandUI bandUI = ribbonBand.getUI();
int preferredCollapsedWidth = bandUI
.getPreferredCollapsedWidth()
+ bandInsets.left + bandInsets.right;
width += preferredCollapsedWidth;
// System.out.println("\t" + ribbonBand.getTitle() + ":" +
// preferredCollapsedWidth);