Alona Kaplan has posted comments on this change.

Change subject: webadmin: Improved network sorting in Setup Networks popup
......................................................................


Patch Set 2: (2 inline comments)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java
Line 555:         }
Line 556:     }
Line 557: 
Line 558:     private void initNetworkModels() {
Line 559:         Collections.sort(allNetworks, new Comparator<Network>() {
This sort should be done in queryNetworks method.
initNetworkModels is called on each redraw. Networks sorting by name should be 
done only once- when fetching the networks from the backend.
There is no action that can be done in the dialog that changes the networks 
names.
Line 560: 
Line 561:             private LexoNumericComparator lexoNumeric = new 
LexoNumericComparator();
Line 562: 
Line 563:             @Override


Line 556:     }
Line 557: 
Line 558:     private void initNetworkModels() {
Line 559:         Collections.sort(allNetworks, new Comparator<Network>() {
Line 560: 
Also, the view is using networkMap.values() (not allNetworks) to display the 
networks.
networkMap is a HashMap, which makes no guarantees as to the order of the map.
If you want to keep the sort on the model side networksMap should be SortedMap 
(LinkedHashMap, TreeMap...)
Line 561:             private LexoNumericComparator lexoNumeric = new 
LexoNumericComparator();
Line 562: 
Line 563:             @Override
Line 564:             public int compare(Network net1, Network net2) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7c7e93f94b4d1082889a6f58d633bdbc140cd42a
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to