My apologies, after more investigation, the problem is not in the buildUI method. The problem is the SwingToolbarContribution constructor which is called before default colors/UI are set in the UIManager. You can check that value with UIManager.get(“Panel.Background”).
I was creating my toolbar view (which I add to the JPanel in buildUI afterwards) in SwingToolbarContribution constructor which at that time, the default color (white) is not set yet.
It’s still an inconsistent behavior since all the other contribution classes are created after colors/UI are set in the UIManager.