DESCRIPTION

Show 'Add to Index' and related team menu entries only when applicable

* Factor out non-decoration related things from DecoratableResource
  into new IResourceState.
* Use this new IResourceState to provide new testable properties
  isStaged, isIgnored, and hasUntrackedChanges.
* plugin.xml: change the menu configurations for 'Add to Index',
  'Remove from Index', and 'Ignore' from deprecated action to
  command/handler and a menuContribution. Provide visibleWhen and
  activeWhen specifications using the new properties.
* Remove now unused RemoveFromIndexAction and IgnoreAction.

Solves part of bug 355809: display of these actions in the team menu.

Bug: 355809
Change-Id: If283be82612b15d14c773eea628777eb79f263ae
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2015-11-22 21:11:53.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/7857/

-------------------------------------
author: Jayvion Booth
date: 2015-11-22 21:12:16.000000000

Patch Set 2:

Bigger one, I will need some time to review it...

-------------------------------------
author: Brenden Conley
date: 2015-11-22 21:34:58.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/7857/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2015-11-22 21:50:50.000000000

Patch Set 2:

(4 comments)

Ok, here's some hints at what I did and where I want to go with this.

Line:40, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResource.java -> Inherited newly from ResourceState.

Line:14, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> I didn't write "resource" on purpose. In a future change, I plan to make the ResourceStateFactory also work for IPath inputs, and then use this in GitActionContributor to fix the appearance of menu items in the context menu of the synchronize view.

Line:33, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java -> Code basically moved from DecoratableResourceAdapter. BTW, what's your policy on such code moves? I feel kinda bad since it now has only my name in the header comment...

Line:100, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/DecoratableResourceAdapter.java -> Code moved to ResourceStateFactory.

-------------------------------------
author: Douglas Trujillo
date: 2015-11-22 22:42:47.000000000

Patch Set 2:

(1 comment)

looks like this large change doing multiple changes could be split into smaller changes which do one change each and build on top of each other.

It's a lot easier to review a pure refactoring which doesn't also add new stuff or does two refactorings in one change

Line:33, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java -> copy the copyright statements if you move larger blocks of code, git blame can help to find out who were the authors of the moved code, but don't spend a lot of time on that

-------------------------------------
author: Alayna Houston
date: 2015-11-23 06:03:00.000000000

Patch Set 2:

> looks like this large change doing multiple changes could be split
 > into smaller changes which do one change each and build on top of
 > each other.

I didn't do so in this case because pulling out the new IResourceState alone gives a change of about +565/-358 with no clear indication of why it was done, and bullets 2 to 4 in above list are really small things (the numbers are misleading; xml is is rather verbose, which bloats the number of changed lines).

But ok, I'll take it apart.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-11-30 23:52:54.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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