DESCRIPTION

Extract non-decoration things into new IResourceState

Separates UI-related things like branch names (actually labels) from
the state of the file in the repository and enables use of this state
elsewhere without incurring overhead for name calculations.

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

COMMENTS

author: Alayna Houston
date: 2015-11-23 06:46:22.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2015-11-23 06:46:28.000000000

Patch Set 3:

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

-------------------------------------
author: Alayna Houston
date: 2015-11-23 06:49:11.000000000

Patch Set 3:

> But ok, I'll take it apart.

Done.

-------------------------------------
author: Brenden Conley
date: 2015-11-23 07:11:04.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Jayvion Booth
date: 2015-11-24 21:42:02.000000000

Patch Set 3:

(2 comments)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java -> Looking at the next changeset I'm wondering why we don't introduce 
@NonNull
public static IResourceState get(IResource)
and later 
@NonNull
public static IResourceState get(File)

Line:118, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java xxx@xxx.xxx

Also I'm wondering if we want to return IResourceState.UNKNOWN constant (to be created) in case we don't get any data from extract* methods.

-------------------------------------
author: Alayna Houston
date: 2015-11-26 06:00:12.000000000

Patch Set 3:

(2 comments)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java -> Yes, static factory methods would be an alternative.

I think ultimately it comes down to a question of programming style. I'd rather not get into that discussion; we could argue for ages about the pros and cons. In other projects, I use an injection framework extensively and would inject this factory, thus this style comes naturally to me. I wouldn't even need to have that static getInstance(), just (maybe) xxx@xxx.xxx annotation.
 
Also, if we used static factory methods, we could move those over to ResourceState itself and do away with this factory class altogether. But I'd like to avoid that; it lumps too many things together.

As for get(File): that's for a follow-up change. I'd first like to get this done for IResource, before I start extending this to File.

I've added the get(IResource) operation in the next change; since I've split this commit, I'd like to keep this one here restricted basically to moving around code.

Line:118, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceStateFactory.java -> Done

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

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

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