correcting stupid SWT bug (at the cost of some ugliness)