Lior Vernia has posted comments on this change.

Change subject: webadmin: adding Affinity Groups views
......................................................................


Patch Set 8:

(8 comments)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/scheduling/affinity_groups/VmsSelectionModel.java
Line 13: import org.ovirt.engine.ui.uicompat.Event;
Line 14: import org.ovirt.engine.ui.uicompat.EventArgs;
Line 15: import org.ovirt.engine.ui.uicompat.IEventListener;
Line 16: 
Line 17: public class VmsSelectionModel extends ListModel<VmSelectionModel> {
Good job.
Line 18: 
Line 19:     public final static Pair<String, VM> SELECT_KEY = new Pair<String, 
VM>("select a VM", null); //$NON-NLS-1$
Line 20:     public final static Pair<String, VM> NO_KEYS = new Pair<String, 
VM>("no available vms", null); //$NON-NLS-1$ 
//ConstantsManager.getInstance().getConstants().noKeyAvailable();
Line 21: 


Line 98: 
Line 99:     public List<Pair<String, VM>> getAvailableKeys() {
Line 100:         Map<Guid, Pair<String, VM>> map = new HashMap<Guid, 
Pair<String, VM>>();
Line 101: 
Line 102:         if (allVmMap != null) {
I actually think I was too lazy to fix this myself, so I'll guess it'll remain 
for some future enhancement :)
Line 103:             for (VM vm : allVmMap.values()) {
Line 104:                 if (!usedVmMap.containsKey(vm.getId())) {
Line 105:                     map.put(vm.getId(), new Pair<String, 
VM>(vm.getName(), vm));
Line 106:                 }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/scheduling/affinity_groups/list/AffinityGroupListModel.java
Line 33: 
Line 34:     private T parentEntity;
Line 35: 
Line 36:     public AffinityGroupListModel() {
Line 37:         
setTitle(ConstantsManager.getInstance().getConstants().affinityGroupsTitle());
As you wish.
Line 38:         setHashName("affinity_groups"); // $//$NON-NLS-1$
Line 39:         setAvailableInModes(ApplicationMode.VirtOnly);
Line 40: 
Line 41:         setNewCommand(new UICommand("New", this)); //$NON-NLS-1$


Line 88:     }
Line 89: 
Line 90:     protected abstract VdcQueryType getQueryType();
Line 91: 
Line 92:     protected abstract ClusterResolver getClusterResolver();
Good point, there's an alternative though that will obviate the need for the 
interface ClusterResolver (which is a bit synthetic to my taste). You could 
have clusterId and clusterName members here, and override onEntityChanged() in 
both concrete subtabs to update them upon selection. There you can use the 
generic nature of parentEntity to perform different actions according to subtab.
Line 93: 
Line 94:     public UICommand getNewCommand() {
Line 95:         return newCommand;
Line 96:     }


Line 129:             return;
Line 130:         }
Line 131: 
Line 132:         AffinityGroupModel model = getNewAffinityGroupModel();
Line 133:         model.init();
Mysterious are the ways of Findbugs... Alright then.
Line 134:         setWindow(model);
Line 135:     }
Line 136: 
Line 137:     protected AffinityGroupModel getNewAffinityGroupModel() {


Line 137:     protected AffinityGroupModel getNewAffinityGroupModel() {
Line 138:         return new NewAffinityGroupModel(this, getClusterResolver()) {
Line 139: 
Line 140:             @Override
Line 141:             protected AffinityGroup getAffinityGroup() {
Looks good.
Line 142:                 return new AffinityGroup();
Line 143:             }
Line 144:         };
Line 145:     }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/scheduling/affinity_groups/model/AffinityGroupModel.java
Line 89:     public EntityModel<String> getName() {
Line 90:         return name;
Line 91:     }
Line 92: 
Line 93:     public void setName(EntityModel<String> name) {
Done?
Line 94:         this.name = name;
Line 95:     }
Line 96: 
Line 97:     public EntityModel<String> getDescription() {


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
Line 3458:     @DefaultStringValue("Polarity")
Line 3459:     String affinityGroupPolarityLabel();
Line 3460: 
Line 3461:     @DefaultStringValue("Enforcing")
Line 3462:     String affinityGroupEnforceTypeLabel();
Fine by me.
Line 3463: 
Line 3464:     @DefaultStringValue("Description")
Line 3465:     String affinityDescriptionLabel();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibe5d6f6efe2b13297b653e1622a26c7b2b44cba8
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to