Skip to content

Commit

Permalink
add ability to choose green color for successful builds
Browse files Browse the repository at this point in the history
( JENKINS-14895 + JENKINS-12132 )
  • Loading branch information
nikom committed Dec 30, 2012
1 parent cb2c550 commit 91e8c79
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
38 changes: 34 additions & 4 deletions src/main/java/maps/hudson/plugin/xfpanel/XFPanelView.java
Expand Up @@ -92,6 +92,8 @@ public class XFPanelView extends ListView {

private Boolean showClaimInfoInUnstable = true;

private Boolean showGreenColor = false;

private transient List<XFPanelEntry> entries;

private transient Map<hudson.model.Queue.Item, Integer> placeInQueue = new HashMap<hudson.model.Queue.Item, Integer>();
Expand Down Expand Up @@ -119,10 +121,19 @@ public XFPanelView(String name, Integer numColumns) {
* @return the colors to use
*/
public XFColors getColors() {
if (this.colors == null) {
this.colors = XFColors.DEFAULT;

if (getShowGreenColor() == true) {
if (this.colors == null) {
this.colors = XFColors.GREEN;
}
return this.colors;
}
else {
if (this.colors == null) {
this.colors = XFColors.DEFAULT;
}
return this.colors;
}
return this.colors;
}

public Integer getGuiHeight() {
Expand Down Expand Up @@ -193,11 +204,18 @@ public Boolean getShowDescription() {

public Boolean getShowBrokenBuildCount() {
if (this.showBrokenBuildCount == null) {
this.showBrokenBuildCount = false;
this.showBrokenBuildCount = Boolean.FALSE;;
}
return this.showBrokenBuildCount;
}

public Boolean getShowGreenColor(){
if (this.showGreenColor == null) {
this.showGreenColor = Boolean.FALSE;
}
return this.showGreenColor;
}

public Boolean getSortDescending() {
if (this.sortDescending == null) {
this.sortDescending = Boolean.FALSE;
Expand Down Expand Up @@ -382,6 +400,7 @@ protected void submit(StaplerRequest req) throws ServletException, FormException
this.autoResizeEntryHeight = Boolean.parseBoolean(req.getParameter("autoResizeEntryHeight"));
this.hideSuccessfulBuilds = Boolean.parseBoolean(req.getParameter("hideSuccessfulBuilds"));
this.showBrokenBuildCount = Boolean.parseBoolean(req.getParameter("showBrokenBuildCount"));
this.showGreenColor = Boolean.parseBoolean(req.getParameter("showGreenColor"));

if ( getIsClaimPluginInstalled() ){
this.guiClaimFont = asInteger(req, "guiClaimFont");
Expand Down Expand Up @@ -1181,7 +1200,18 @@ public String getOtherFG() {

public static final XFColors DEFAULT =
new XFColors("#7E7EFF", "#FFFFFF", "#FFC130", "#FFFFFF", "#FF0000", "#FFFFFF", "#CCCCCC", "#FFFFFF");

/*
* okBG , okFG , failedBG , failedFG , brokenBG , brokenFG , otherBG ,
* otherFG FFFFFF = white FF0000 = red 7E7EFF = blue FFC130 = yellow
* 215E21 = huntergreen #267526 = another green
*/
public static final XFColors GREEN = new XFColors("#267526", "#FFFFFF",
"#FFC130", "#FFFFFF", "#FF0000", "#FFFFFF", "#CCCCCC",
"#FFFFFF");

}


}

Expand Up @@ -65,6 +65,10 @@
<f:entry title="${%Hide successful builds}" field="hideSuccessfulBuilds">
<f:checkbox id="xfpanel.hideSuccessfulBuilds" name="hideSuccessfulBuilds" checked="${it.hideSuccessfulBuilds}" value="true"/>
</f:entry>
<f:entry title="${%Use green color for successful build}" field="showGreenColor">
<f:checkbox id="xfpanel.showGreenColor" name="showGreenColor" checked="${it.showGreenColor}" value="true" />
</f:entry>


<td colspan="3" style="font-weight:bold;" >Build responsibles <hr /> </td>
<f:entry title="${%Show Responsibles}" field="responsibles">
Expand Down

0 comments on commit 91e8c79

Please sign in to comment.