Bug? colorBar effect from code

Hello, i think its a bug.

creating the colorBar effect from code works wrong.

[java]

PanelBuilder bp = new PanelBuilder();

bp.childLayoutCenter();

bp.visibleToMouse();

mainPanel.panel(bp);

bp.control(new LabelBuilder(){{

width("100%");

text(text);

color(Color.WHITE);

textVAlignCenter();

textHAlignLeft();

paddingLeft("10px");

alignCenter();

valignCenter();

}});



bp.onHoverEffect(new HoverEffectBuilder("colorBar"){{

set("color", "#FFFF");

}});*/

[/java]

The color of the text changes to the color u set in the effect and without onHover is active.

when onHover is active the colorBar is painted always in white.

One of the problem with the Builder pattern stuff is, that you could accidently call methods of some of your parent elements! In your case there is no “set” method in the HoverEffectBuilder. The method you need to call is effectParameter(“color”, “#ffff”) instead of set(“color”, “#ffff”).



This “issue” was explained on the blog. Unfortunatly we’ve not found a way to automatically detect that kind of errors.

big thx :slight_smile: