DESCRIPTION

CreateTagDialog: improve UI Responsiveness

This improves UI responsiveness of the CreateTagDialog by filling the
"Existing Tags" list asynchronously and by filling the "Commit" combo
box lazily when opening the "Advanced" section.
While the tag list is filled, a "Loading..." node is shown instead and the
list is inactive. Still it is possible to use the dialog while the list is filled.
In addition, the content provider for the tag list was changed to a simple
ArrayContentProvider which saves some extra overhead.

Bug: 324108
Change-Id: Ic1925916e0131a5aee96d92fe56053f0f5ec4f2f
Signed-off-by: Willow Cantrell xxx@xxx.xxx


COMMENTS

author: Jaylon Avila
date: 2010-09-30 13:17:26.000000000

Patch Set 1: (3 inline comments)

I haven't actually tested the code but it seems okay. I would have considered a) using DeferredTreeContentManager but that might be a little bit much or b) having the tags retrieved before the population of the dialog but I think the "Loading..." message should be sufficient.

If you want to refine the behaviour even further, you could add support for progress monitoring and reporting...though I realize you've set it up to be a system job at the moment (though system jobs can be displayed in the 'Progress' view actually). If progress monitoring was implemented then the job could support cancellation properly when the user just closes the dialog before the table actually gets populated. As it is right now, all the tags are retrieved even if the dialog has already been closed.

-------------------------------------
author: Willow Cantrell
date: 2010-09-30 13:29:40.000000000

Patch Set 1: (3 inline comments)



Line:270, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done. Good point, thanks.

Line:483, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

Line:607, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Done

-------------------------------------
author: Jaylon Avila
date: 2010-09-30 13:17:25.000000000

MISMATCHED INLINE COMMENT
Line:270, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> It is generally better to use asyncExec(Runnable) instead of syncExec(Runnable). The work is being done asynchronously on a separate thread anyway so I see no hard requirement for this table population to be done immediately.

Please do change the code to not use Display.getDefault() (you can swap with getShell().getDisplay()) though.

-------------------------------------
author: Jaylon Avila
date: 2010-09-30 13:17:25.000000000

MISMATCHED INLINE COMMENT
Line:483, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> I believe we are on 3.5 now, correct? You can just call ArrayContentProvider.getInstance() instead then.

-------------------------------------
author: Jaylon Avila
date: 2010-09-30 13:17:25.000000000

MISMATCHED INLINE COMMENT
Line:607, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CreateTagDialog.java -> Technically speaking, this isn't mandatory because an ArrayContentProvider actually takes both an array and a java.util.Collection. If you look at the implementation, we will call toArray() for you. So really, it is up to you if you want to call toArray() now or later, I just thought I would point it out for your information (about how ArrayContentProvider works).

-------------------------------------
