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 interested in work such as this, Arne.  Happy help with code review and might have time to contribute.

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 Thu, Aug 31, 2017 at 6:55 AM, Daniel Megert <daniel_megert@xxxxxxxxxx> wrote:
Hi Arne

Personally, I think it makes good sense if there is really a project that wants to plug in another selection mode. Otherwise it's better to spend the energy on another topic that brings additional value, e.g. some existing StyledText bugs/features.

Having said that, you're welcome to experiment with this. We have an e4 incubator project that can be used to implement and test such changes. SWT can be cloned there and you can work directly in the SWT code. Once that code has production quality, it can be moved to the platform.

HTH
Dani



From:        Arne Deutsch <arne@xxxxxxxxxxxxx>
To:        platform-swt-dev@xxxxxxxxxxx
Date:        26.08.2017 15:12
Subject:        [platform-swt-dev] Extract SelectionMode out of StyledText
Sent by:        platform-swt-dev-bounces@eclipse.org




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





_______________________________________________
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