Daniel Erez has posted comments on this change.

Change subject: webadmin: Fix vm pop-up host tab logic
......................................................................


Patch Set 3: (6 inline comments)

....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
Line 644:                 return ((VDS) object).getName();
Line 645:             }
Line 646:         });
Line 647: 
Line 648:         migrationModeEditor = new ListModelListBoxEditor<Object>(new 
NullSafeRenderer<Object>() {
use EnumRenderer instead
Line 649:             @Override
Line 650:             public String renderNullSafe(Object object) {
Line 651:                 return ((EntityModel) object).getTitle();
Line 652:             }


....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
Line 200:               float: left;
Line 201:         }
Line 202: 
Line 203:         .migrationSelect {
Line 204:               margin-right: 174px;
tws
Line 205:         }
Line 206:         
Line 207:       </ui:style>
Line 208: 


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
Line 62:     public static final int VM_TEMPLATE_NAME_MAX_LIMIT = 40;
Line 63:     public static final int DESCRIPTION_MAX_LIMIT = 255;
Line 64: 
Line 65:     private boolean privateIsNew;
Line 66:     private static final EntityModel MIGRATABLE_ENTITY = new 
EntityModel(MigrationSupport.MIGRATABLE);
no need for these constants (explanation on next comment...)
Line 67:     private static final EntityModel IMPLICITLY_NON_MIGRATABLE_ENTITY 
= new EntityModel(MigrationSupport.IMPLICITLY_NON_MIGRATABLE);
Line 68:     private static final EntityModel PINNED_TO_HOST_ENTITY = new 
EntityModel(MigrationSupport.PINNED_TO_HOST);
Line 69: 
Line 70:     public boolean getIsNew()


Line 1532: 
Line 1533:     private void initMigrationMode() {
Line 1534:         ArrayList<EntityModel> migrationModes = new 
ArrayList<EntityModel>();
Line 1535:         Constants constants = 
ConstantsManager.getInstance().getConstants();
Line 1536:         MIGRATABLE_ENTITY.setTitle(constants.autoAndManMigration());
just use an EnumRenderer in the view instead of localization in the model
(and modify Enums.properties...)
Line 1537:         
IMPLICITLY_NON_MIGRATABLE_ENTITY.setTitle(constants.manualMigrationOnly());
Line 1538:         PINNED_TO_HOST_ENTITY.setTitle(constants.noMigration());
Line 1539: 
Line 1540:         migrationModes.add(MIGRATABLE_ENTITY);


Line 1536:         MIGRATABLE_ENTITY.setTitle(constants.autoAndManMigration());
Line 1537:         
IMPLICITLY_NON_MIGRATABLE_ENTITY.setTitle(constants.manualMigrationOnly());
Line 1538:         PINNED_TO_HOST_ENTITY.setTitle(constants.noMigration());
Line 1539: 
Line 1540:         migrationModes.add(MIGRATABLE_ENTITY);
instead, initialize with 'List<MigrationSupport> migrationModes = 
Arrays.asList(MigrationSupport.values());'
Line 1541:         migrationModes.add(IMPLICITLY_NON_MIGRATABLE_ENTITY);
Line 1542:         migrationModes.add(PINNED_TO_HOST_ENTITY);
Line 1543:         getMigrationMode().setItems(migrationModes);
Line 1544:     }


Line 1768:         }
Line 1769:     }
Line 1770: 
Line 1771:     public void setMigrationMode(MigrationSupport value) {
Line 1772:         for (Object migrationModeEntityModel : 
getMigrationMode().getItems()) {
not needed after using Enum...
Line 1773:             if (((EntityModel)migrationModeEntityModel).getEntity() 
== value) {
Line 1774:                 
getMigrationMode().setSelectedItem(migrationModeEntityModel);
Line 1775:                 break;
Line 1776:             }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4da1be4919913b7739f4139299d2c88958488d0
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to