Community
Participate
Working Groups
Create a common interface between Table-Tree, TableItem-TreeItem, TableColumn-TreeColumn to allow classes to work against either widget. This will allow for simplification of the JFace viewers. It will also allow the Nebula Grid to implement the same interfaces and utilize the viewers as well. See bug 149193.
Could abstract classes be used rather than interfaces?
I'm assuming you want to avoid the problem of brittle interfaces? i.e. interface2, interface3, etc... An abstract class is ok as long as its design doesn't preclude a class other than Table or Tree extending it.
This has come up before and the consensus has been to not add such interfaces to swt. SN if anything has changed here then please reopen this report. In the meantime marking as a duplicate. *** This bug has been marked as a duplicate of 4394 ***
We may yet to do this with an abstact class. We wouldn't do this with an interface for reasons that go beyond the scope of this bug report. There is a move afoot to add a Header and HeaderItem class (but this is waiting on the 3.3 plan). It's possible that TableColumn and TreeColumn would be subclasses of this.
<voice type="Homer Simpson>wahoo!</voice> btw, I would be interested to hear the reasoning behind avoiding interfaces out of curiousity (brittle? added complexity for little gain? having to enforce exact behavior between classes?). Maybe it could be a blog post.