I wrote this widget:
public class GroupLbl extends Composite implements ClickHandler, MouseOutHandler {
private Label lbl;
private GroupLblHandler lblHandler = null;
private HorizontalPanel hp;
public void onClick(ClickEvent event) {
hp.setStyleName("background-GroupLbl");
if (event.getSource().equals(folder) || event.getSource().equals(lbl)) {
lblHandler.onGroupLabelSelect(this);
}
}
public GroupLbl(String title, GroupLblHandler handler) {
hp.add(lbl);
lblHandler = handler;
if (handler != null) {
lbl.addClickHandler(this);
}
initWidget(hp);
}
@Override
public Widget getWidget() {
return hp;
}
public void onMouseOut(MouseOutEvent event) {
hp.removeStyleName("background-GroupLbl");
}
} I use this widget in my form when the user clicks on one of the INSTANCE widget to which this name should be assigned, and when the user clicks on the other, the style name should be assigned to it, and the first shoud removes the style name that I implemented mouseouthandler but it doesn’t work, the style sets bgcolor to hp so that the user understands which grouplbl he has chosen. What am I doing (is this part of my code)? tnx and excuse me for my bad english !!!
source
share