DESCRIPTION

Removed checkedItems field from GitProjectsImportPage; added a getCheckedProjects method instead, which computes the set of checked projects based on information available from the UI widgets.

This fixes at least one bug that was affecting my work: unchecking projects by using the spacebar didn't work, because there was no KeyListener in place to update the checkedItems field. This lead to the project being unchecked in the UI, but still considered checked by the wizard page, and upon clicking Finish, the wizard would try to import all of those unchecked projects.


COMMENTS

author: Willow Cantrell
date: 2010-04-08 06:14:07.000000000

Patch Set 1: I would prefer that you didn't submit this

Almost perfect. Just check my comments.

Line:233, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java -> This should probably be 

setPageComplete(!getCheckedProjects().isEmpty());

?

Line:341, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java -> Above we use
setPageComplete(!getCheckedProjects().isEmpty());
so in terms of clarity, it might be good to refactor this into some checkPage() method and call this from the different places where the page completion flag is set.

Line:405, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java -> See above

Line:652, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java -> for single lines, we do not want to have brackets

Line:653, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitProjectsImportPage.java -> for single lines, we do not want to have brackets

-------------------------------------
author: Willow Cantrell
date: 2010-04-08 18:25:13.000000000

Patch Set 1:

Another remark: it would be helpful to format the commit text in such a way as to have a short first line for quick reference followed by a description with lines of around 70 chars. The problem can be seen when looking at this page.

-------------------------------------
author: Jay Ford
date: 2010-04-08 18:36:13.000000000

Patch Set 1: No score

How can I submit the changes you're asking for (all of which I agree with)? I hear it's frowned upon to push --force an amended commit to a public repository.

-------------------------------------
author: Willow Cantrell
date: 2010-04-09 07:57:26.000000000

Patch Set 1:

Hmm... You simply amend your commit and make sure to have the Change-Id: <this change's ID> in the commit message (here, the ID is I5c0889e9f6e95c2c62d96195623499802ce701a1, see header). Not quite sure what are allowed places for this line, I always put it before the Signed-off line.
Not sure why you would need a force. If the ID you provide in the commit message is found in Gerrit, a second Patch set is added to this change when you use the push command as described in the contributor guide. Did I miss something?

-------------------------------------
author: Marlie Beasley
date: 2010-04-09 09:17:41.000000000

Patch Set 1: No score

Code looks better know. But getCheckedProjects() is an expensive method looping over the whole tree. Does this scale for bigger trees?

-------------------------------------
author: Jay Ford
date: 2010-04-09 18:00:07.000000000

Patch Set 1:

I had the same concern, but the input size (number of projects) will usually be bounded to something reasonable. For example, working with OSEE involves over 100 projects, and the UI performance was fine with my changes.

(I would imagine that there are many other cases where all the projects in the tree are being looped over. For example, Select All/None not only loop over all the TreeItems, but perform corresponding UI updates for all of them to redraw the checkboxes in the correct state.)

In any case, if it turns out to be slow for some people, it can be optimized later, but my first priority was to make the code correct.

-------------------------------------
author: Jay Ford
date: 2010-04-11 21:41:04.000000000

Patch Set 1:

I've made the requested changes, a new review has been started here: http://egit.eclipse.org/r/#change,548

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