[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Interfaces to common control features

This has come up several times in the past.  The request for it is
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4394 , though I don't think
this is likely to happen.

Grant


"Viliam Durina" <viliam.durina@xxxxxxxxx> wrote in message
news:g2ak99$35g$1@xxxxxxxxxxxxxxxxxxxx
> Hello,
>
> we develop a framework where developers draw controls visually and are
able to create an application, that can be run as an web application as well
as an SWT one. Developer that uses the framework provides a factory to
create individual controls that the framework fills in with data and
listeners to handle actions.
>
> And here is the problem: we cannot replace Combo with CCombo, as they do
not have common interface. If one application decides to use the native
Combo and another CCombo due to its flexibility, the factory has to return a
Control and we have to implement both cases.
>
> What do you think about the idea of creating a hierarchy of interfaces
like IWidget, IControl, ICombo, IButton with methods of their non-I
counterparts and all controls implementing some of them? Even third-party
custom fancy controls could implement one of these interfaces and they could
be replaced in applications easily without making structural changes... And,
for instance, ComboViewer would not need to always test if it uses Combo or
CCombo.
>
> Viliam