Bug 479800

Summary: [UCOSP] create a BuildStatusAttributeEditor and use it to show build status
Product: z_Archived Reporter: Sam Davis <sam.davis>
Component: MylynAssignee: Kyle Ross <kross11>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: andermaj
Version: unspecifiedKeywords: contributed, noteworthy
Target Milestone: 2.9   
Hardware: All   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/59179
https://git.eclipse.org/r/62283
https://git.eclipse.org/c/mylyn/org.eclipse.mylyn.reviews.git/commit/?id=625b620692d84e60d6645dcc2a1c2efb709cec66
Whiteboard:
Bug Depends on:    
Bug Blocks: 477862    

Description Sam Davis CLA 2015-10-14 17:59:45 EDT
Create a BuildStatusAttributeEditor and use it to show build statuses in the Gerrit task editor.
Comment 1 Sam Davis CLA 2015-10-14 18:04:17 EDT
Basically, you can just implement createControl so that it creates the CLabels that are currently being created directly in the review section, and you can override decorateIncoming so that it calls setBackground on each changed build (those where model.hasIncomingChanges(attribute) is true).
Comment 2 Kyle Ross CLA 2015-10-18 14:30:27 EDT
I am thinking of creating the BuildStatusAttributeEditor class in tasks.ui.editors, amongst the other attribute editors. I see that editors such as the BooleanAttributeEditor and the LastCommentedAttributeEditor, for example, are created by the AttributeEditorFactory's createEditor method. Should the BuildStatusAttributeEditor be created by this Factory?
Comment 3 Kyle Ross CLA 2015-10-19 17:18:32 EDT
BuildStatusAttributeEditor has been implemented in the tasks.ui.editors, but is used in ReviewSetContentSection, which implies importing from Tasks into a Review class. Also, access to the enumeration BuildStatus and ReviewImages (both from Reviews) is needed in BuildStatusAttributeEditor and create circular dependencies. The easy solution to the above issues would be to move BuildStatusAttributeEditor to Reviews, but that would be inconsistent with the location of all the other AttributeEditor classes.
Comment 4 Sam Davis CLA 2015-10-20 17:33:39 EDT
You can put the BuildStatusAttributeEditor in reviews since it will only be used by review connectors. It's common for connectors to define their own attribute editors. GerritTaskEditorPage defines its own attribute editor factory where you can create the editor.

I think you might not need to use BuildStatus in the editor though, since it seems like that is only used when parsing the comments. In the editor you already have TaskAttributes.
Comment 5 Kyle Ross CLA 2015-10-24 11:08:36 EDT
I have successfully used the GerritTaskEditorPage's factory to create the editor in ReviewSetContentSection.

Currently working on the decorateIncoming related task.
Comment 6 Eclipse Genie CLA 2015-10-28 17:47:56 EDT
New Gerrit change created: https://git.eclipse.org/r/59179
Comment 7 Eclipse Genie CLA 2015-12-09 00:43:05 EST
New Gerrit change created: https://git.eclipse.org/r/62283
Comment 9 Sam Davis CLA 2015-12-09 14:25:08 EST
.