Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Extract SelectionMode out of StyledText

I'm not an SWT developer.  I have similar needs (wanting to make non-conservative changes to SWT).  One approach I've considered would be to setup an "swt-experimental" project, with a looser contribution model, and SWT could cherry-pick proven stuff from swt-experimental.  So long as swt-experimental doesn't change the natives and rebases for every SWT release, it ought to stay manageable.

Ideally these things could be done without forking SWT, but there is some API which is package-private that makes it impossible.

A real SWT dev probably has better ideas :)

Ned Twigg
Lead Software Architect, DiffPlug LLC
540-336-8043 (cell)
888-513-6870 (fax)
340 S Lemon Ave #343
3, Walnut, CA 91789

On Sat, Aug 26, 2017 at 6:12 AM, Arne Deutsch <arne@xxxxxxxxxxxxx> wrote:
Hi all,

I have a question about a bit bigger contributions then just simple
fixes. I have already contributed test cases for StyledText widget and
fixed an NPE but would like to contribute a bit more. Especially to the
StyledText widget because I think it is somewhat central to eclipse and
it would be good if it would get some love.

Actually I have inspected the code and think the current code style does
not scale well. For axample the block selection mode (great feature,
really appreciate it!) is added with just a bunch of if statements to
the main class. Around 800-900 LOCs of a total of around 10500 LOCs are
just added for block selection, complicating the main class. Adding a
third selection mode (e.g. select all the same words in the document as
a "poor mans rename refactoring") will not be nice, because then each
method would get a third 'if' statement.

I think it should be possible to extract some "SelectionMode" interface
and provide two implementations "DefaultSelectionMode" and
"BlockSelectionMode". This would extract more then 10% of the LOCs from
the mail class. Should ease maintanance at least. Adding some public
method to set a custom/additional SelectionMode would then enable
us/customers to add arbitrary selection modes without to complicate the
main widget further.

Of course such a refactoring would be quite some work and needs to be
done very carefully, extensivly tested. And needs agreement from
commiters. What would be the best way to initiate such a refactoring?
Just create a bugzilla ticket and start discussion there? Provide some
prototype? Would be great if you could advise about the best way to proceed.

Kind regards,
Arne Deutsch
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top