Arik Hadas has uploaded a new change for review.

Change subject: frontend: minor refactoring in make template code
......................................................................

frontend: minor refactoring in make template code

Change-Id: I059662024475acb184046e138a31fc1931642de6
Signed-off-by: Arik Hadas <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
2 files changed, 19 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/82/23382/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
index fb7a57b..e899752 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
@@ -523,14 +523,15 @@
         windowModel.initialize(null);
         windowModel.getIsTemplatePublic().setEntity(false);
 
-        UICommand tempVar = new UICommand("OnNewTemplate", this); //$NON-NLS-1$
-        tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
-        tempVar.setIsDefault(true);
-        windowModel.getCommands().add(tempVar);
-        UICommand tempVar2 = new UICommand("Cancel", this); //$NON-NLS-1$
-        
tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
-        tempVar2.setIsCancel(true);
-        windowModel.getCommands().add(tempVar2);
+        windowModel.getCommands().add(
+                new UICommand("OnNewTemplate", this) //$NON-NLS-1$)
+                .setTitle(ConstantsManager.getInstance().getConstants().ok())
+                .setIsDefault(true));
+
+        windowModel.getCommands().add(
+                new UICommand("Cancel", this) //$NON-NLS-1$
+                
.setTitle(ConstantsManager.getInstance().getConstants().cancel())
+                .setIsCancel(true));
     }
 
     private void onNewTemplate()
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
index cae17b1..e20c628 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
@@ -1213,12 +1213,7 @@
     private void newTemplate()
     {
         VM vm = (VM) getSelectedItem();
-        if (vm == null)
-        {
-            return;
-        }
-
-        if (getWindow() != null)
+        if (vm == null || getWindow() != null)
         {
             return;
         }
@@ -1232,14 +1227,15 @@
 
         model.initialize(getSystemTreeSelectedItem());
 
-        UICommand tempVar = new UICommand("OnNewTemplate", this); //$NON-NLS-1$
-        tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
-        tempVar.setIsDefault(true);
-        model.getCommands().add(tempVar);
-        UICommand tempVar2 = new UICommand("Cancel", this); //$NON-NLS-1$
-        
tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
-        tempVar2.setIsCancel(true);
-        model.getCommands().add(tempVar2);
+        model.getCommands().add(
+                new UICommand("OnNewTemplate", this) //$NON-NLS-1$
+                .setTitle(ConstantsManager.getInstance().getConstants().ok())
+                .setIsDefault(true));
+
+        model.getCommands().add(
+                new UICommand("Cancel", this) //$NON-NLS-1$
+                
.setTitle(ConstantsManager.getInstance().getConstants().cancel())
+                .setIsCancel(true));
 
         
model.getIsHighlyAvailable().setEntity(vm.getStaticData().isAutoStartup());
     }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I059662024475acb184046e138a31fc1931642de6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to