From 6c24bc3d7241af9a75ca487eb21b3b6cb87742bf Mon Sep 17 00:00:00 2001 From: Carsten Madsen Date: Tue, 5 Aug 2014 12:57:07 +0200 Subject: [PATCH] Avoid illegal state exception. --- .../test/java/utest/ribbon/RibbonBandTestCase.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flamingo/src/test/java/utest/ribbon/RibbonBandTestCase.java b/flamingo/src/test/java/utest/ribbon/RibbonBandTestCase.java index d31e351b..7aa2762b 100644 --- a/flamingo/src/test/java/utest/ribbon/RibbonBandTestCase.java +++ b/flamingo/src/test/java/utest/ribbon/RibbonBandTestCase.java @@ -1,6 +1,8 @@ package utest.ribbon; import java.awt.Color; +import java.util.Arrays; +import java.util.List; import javax.swing.JFrame; @@ -11,7 +13,13 @@ import org.junit.Test; import org.pushingpixels.flamingo.api.common.JCommandButton; import org.pushingpixels.flamingo.api.common.icon.EmptyResizableIcon; -import org.pushingpixels.flamingo.api.ribbon.*; +import org.pushingpixels.flamingo.api.ribbon.JRibbon; +import org.pushingpixels.flamingo.api.ribbon.JRibbonBand; +import org.pushingpixels.flamingo.api.ribbon.JRibbonFrame; +import org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup; +import org.pushingpixels.flamingo.api.ribbon.RibbonElementPriority; +import org.pushingpixels.flamingo.api.ribbon.RibbonTask; +import org.pushingpixels.flamingo.api.ribbon.resize.IconRibbonBandResizePolicy; public class RibbonBandTestCase extends FestSwingJUnitTestCase { private JRibbonFrame frame; @@ -43,6 +51,9 @@ private JRibbonBand createBand(int buttonCount, String title, + (i + 1), new EmptyResizableIcon(32)), RibbonElementPriority.TOP); } + result.setResizePolicies((List) Arrays + .asList(new IconRibbonBandResizePolicy(result + .getControlPanel()))); return result; }