Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Inheritance and SWT

>>>>>> Why is it impossible resp. only possible from within swt
implementation to extend classes like Text or Button. Could >>>>>> anyone
explain the reasons for these restrictions?


In the javadoc somewhere, it says somewhere that they only want to support
inheritance from some tightly controlled points. I guess it actually means
that they don't want to guarantee that they will continue supporting the
protected methods, you would have access to, when you inherit from these
widgets. Only the public methods are then part of the backwards-compatible
API.

If you don't like it (I don't either), you may disable the check for it in:

org/eclipse/swt/widgets/Widget.java:566:boolean isValidSubclass () {

Make this method return true in every case; from then on you can subclass as
much as you want.



Back to the top