You must override the checkSubclass method to do nothing, otherwise it will complain about the subclass being invalid - because usually you should not override the standard components.
@Override protected void checkSubclass() {
You should also consider creating custom widgets containing primitive controls using delegation. For example, you can create a MyText that will contain a text widget inside with a custom setting.
Remember that SWT provides standard controls that look native to each platform. In any case, polishing of standard components is still permitted and even required in production software.
source share