Bug 547938 - [Snippets] Some improvements for SWT Snippets
Summary: [Snippets] Some improvements for SWT Snippets
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.12   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.12 RC2   Edit
Assignee: Paul Pazderski CLA
QA Contact: Eric Williams CLA
URL:
Whiteboard:
Keywords: example
Depends on:
Blocks:
 
Reported: 2019-06-04 18:21 EDT by Paul Pazderski CLA
Modified: 2019-06-10 13:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Pazderski CLA 2019-06-04 18:21:39 EDT
While creating the SnippetExplorer I found some minor issues or things to improve on some of the existing Snippets. Instead of opening a bug for every minor change or open non at all I summarize them here.
Comment 1 Eclipse Genie CLA 2019-06-04 18:22:41 EDT
New Gerrit change created: https://git.eclipse.org/r/143314
Comment 2 Paul Pazderski CLA 2019-06-04 18:23:13 EDT
> https://git.eclipse.org/r/143314

A Snippet should never call System.exit(). Doing so will break the SnippetLauncher (the launcher exits too and can not start the next Snippet) and can break the new SnippetExplorer (depends on selected runner).
Comment 3 Eclipse Genie CLA 2019-06-04 18:24:55 EDT
New Gerrit change created: https://git.eclipse.org/r/143315
Comment 4 Paul Pazderski CLA 2019-06-04 18:25:21 EDT
> https://git.eclipse.org/r/143315

Some Snippets initialize Display and/or Shell on class initialization. SnippetLauncher and especially my new SnippetExplorer may launch Snippets more than once without reinitializing the class. Therefore the Display and/or Shell is already disposed on the second launch and the Snippet crash.
Comment 5 Eclipse Genie CLA 2019-06-04 18:26:08 EDT
New Gerrit change created: https://git.eclipse.org/r/143316
Comment 6 Paul Pazderski CLA 2019-06-04 18:26:26 EDT
> https://git.eclipse.org/r/143316

Some Snippets run threads with setDaemon(true) and expect them to stop on Snippet end. This is not the case if the Snippet is run through SnippetLauncher or SnippetExplorer where the Daemon-Threads survive until those launchers end.
Comment 7 Eclipse Genie CLA 2019-06-04 18:30:21 EDT
New Gerrit change created: https://git.eclipse.org/r/143317
Comment 8 Paul Pazderski CLA 2019-06-04 18:31:15 EDT
> https://git.eclipse.org/r/143317

Snippet 13 does not work on Linux and not so good on Windows too. The painting should be done in the paint listener and not as a one-shot after open.
There also seem to be a more general problem when painting on Linux with 'new GC' instead of event.gc. See Bug 546482.
Comment 9 Eclipse Genie CLA 2019-06-04 18:32:35 EDT
New Gerrit change created: https://git.eclipse.org/r/143318
Comment 10 Paul Pazderski CLA 2019-06-04 18:33:03 EDT
> https://git.eclipse.org/r/143318

Snippet 25 has an empty window which can instead show a simple help text what to do to use the Snippet.
Comment 11 Eclipse Genie CLA 2019-06-04 18:37:49 EDT
New Gerrit change created: https://git.eclipse.org/r/143319
Comment 12 Paul Pazderski CLA 2019-06-04 18:38:08 EDT
> https://git.eclipse.org/r/143319

Snippet 268 perform some automated mouse scrolling. It is not predictable if the system will scroll the selected widget regardless of mouse position or what's under the mouse cursor regardless of focus. For the later case (e.g. Windows 10) the Snippet should place the mouse over the test window before scrolling.
Comment 13 Eclipse Genie CLA 2019-06-04 18:46:02 EDT
New Gerrit change created: https://git.eclipse.org/r/143320
Comment 14 Paul Pazderski CLA 2019-06-04 18:46:14 EDT
> https://git.eclipse.org/r/143320

This adds some basic tips for creating Snippets to Readme including things fixed with this bug.
Comment 15 Eric Williams CLA 2019-06-04 22:54:44 EDT
Thank you very much for the improvement! I've added myself to the Gerrit changes and will review them in the next few days.

As a side note, you can add me to any SWT-GTK Gerrits, or SWT Gerrits which do not deal with Windows/Cocoa specific items (snippets, tests, website, etc.).
Comment 16 Paul Pazderski CLA 2019-06-05 02:06:17 EDT
Thanks Eric and just in case you don't know: I could also merge them myself. So it's always nice to have a second opinion and I'll remember you if I got new GTK related problems but if you have better things to do you don't need to review every little of my changes (or less intense).
Comment 17 Eric Williams CLA 2019-06-05 09:07:41 EDT
(In reply to Paul Pazderski from comment #16)
> Thanks Eric and just in case you don't know: I could also merge them myself.
> So it's always nice to have a second opinion and I'll remember you if I got
> new GTK related problems but if you have better things to do you don't need
> to review every little of my changes (or less intense).

Yeah I just realized you're already a committer! :)
Comment 24 Niraj Modi CLA 2019-06-06 03:32:26 EDT
We are done with 4.12 RC2, final IBuild verification is in progress.
Resolving for 4.12

Please raise a new bug for any further improvements in SWT Snippets.
Comment 25 Eric Williams CLA 2019-06-06 10:16:47 EDT
(In reply to Niraj Modi from comment #24)
> We are done with 4.12 RC2, final IBuild verification is in progress.
> Resolving for 4.12
> 
> Please raise a new bug for any further improvements in SWT Snippets.

Paul, please file a new ticket for the remaining Gerrits from this bug that I didn't merge. We'll merge them in 4.13.