Vojtech Szocs has posted comments on this change.

Change subject: webadmin: migration progress
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.ovirt.org/#/c/26827/1/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/ProgressBarColumn.java
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/ProgressBarColumn.java:

Line 29:     /**
Line 30:      * Default color scheme for the progress bar - override if other 
colors are needed
Line 31:      */
Line 32:     protected String getColorByProgress(int progress) {
Line 33:         return progress < 70 ? "#669966" : progress < 95 ? "#FF9900" : 
"#FF0000"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
I think that double ternary operator here might be a bit confusing, maybe we 
can simply use if-else statement instead:

 if (progress < 70) {
     return "#669966";
 } else if (progress < 95) {
     return "#FF9900";
 } else {
     return "#FF0000";
 }

Also please consider extracting these colors into public static final fields, 
i.e. OneColorPercentColumn could use ProgressBarColumn.GREEN or similar 
constant.
Line 34:     }
Line 35: 
Line 36:     /**
Line 37:      * Returns the progress value in percent ({@code null} values will 
be interpreted as zeroes).


-- 
To view, visit http://gerrit.ovirt.org/26827
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I31cb4fefe897536b633cce1583881e1e3511c0e8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to