I have a composite, which should collapse under certain circumstances.
When the composite is collapsed – something the state should be signalized, by drawing an image of a collapsed composite.
How would I implement this is SWT? Can I somehow take over the drawing, and draw something else on the widget’s canvas?
You should take a look at StackLayout.
With a StackLayout, you can put a widget there that shows the desired image. When you want to “collapse” your composite, you simply move it back so that is is invisible and put the image on top of the StackLayout.