void (Container container) { Dimension prefSize = preferredLayoutSize(container); if (prefSize.width > 0 && prefSize.height > 0) { Insets i = container.getInsets(); JBInsets.removeFrom(prefSize, i); int offset = i.left; for (Pair<Component, String> c : actionButtons) { if (c.first.isVisible()) { Dimension cPrefSize = c.first.getPreferredSize(); if (c.first instanceof TrafficLightButton) { c.first.setBounds(offset, i.top, cPrefSize.width, prefSize.height); offset += cPrefSize.width; } else { Insets jcInsets = ((JComponent)c.first).getInsets(); JBInsets.removeFrom(cPrefSize, jcInsets); if (ActionToolbar.SEPARATOR_CONSTRAINT.equals(c.second)) { c.first.setBounds(offset, i.top, cPrefSize.width, prefSize.height); offset += cPrefSize.width; } else { int maxBareHeight = prefSize.height - jcInsets.top - jcInsets.bottom; int width = Math.max(cPrefSize.width, maxBareHeight) + jcInsets.left + jcInsets.right; c.first.setBounds(offset, i.top, width, prefSize.height); offset += width; } } } } } }