I have created a GWT widget which is button. The button has two states: up and down. I want to change the image (icon) on the top of the button depending on the state of the button.

I thought the best way for this is to create separate style for both button states:

```
.buttonStateDown {
   color: red;
   background: ... here should be icon ImageResource. how to specify it? ...
}

.buttonStateUp {
   color: black;
   background: ... here should be icon ImageResource. how to specify it? ...
}

```

But I cannot figure how should I specify the backgrounds of these classes which are the icons of my button?

There can be several instances of my button with different icons. Consequently I cannot hardcode image resource into that 2 styles. I should inject them while creating the button. Indeed, I can inject ImageResources via constructor or via setters. But the question is: how can I pass that resources to the styles I mentioned above?