Martin Mucha has uploaded a new change for review.

Change subject: webadmin: refactor—overgrown constructor
......................................................................

webadmin: refactor—overgrown constructor

- overgrown constructor split to smaller, single purpose methods
(I need to add next gui code there, and it's too long already)
- make all parameters final, if they can be final, not just some.

Change-Id: I05d1ec1064eb3ec4ce17f88a2d532cb76aa4f39d
Signed-off-by: Martin Mucha <mmu...@redhat.com>
---
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/macpool/SharedMacPoolView.java
1 file changed, 29 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/32210/4

diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/macpool/SharedMacPoolView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/macpool/SharedMacPoolView.java
index e3dbd1e..4462bba 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/macpool/SharedMacPoolView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/macpool/SharedMacPoolView.java
@@ -22,24 +22,41 @@
 
 public class SharedMacPoolView extends Composite {
 
-    private SplitLayoutPanel rootPanel;
-    private SimpleActionTable<MacPool> macPoolTable;
+    private final SimpleActionTable<MacPool> macPoolTable;
 
     @Inject
     public SharedMacPoolView(final SharedMacPoolModelProvider 
sharedMacPoolModelProvider,
-            EventBus eventBus,
-            ClientStorage clientStorage,
-            MainTableHeaderlessResources headerlessResources,
-            MainTableResources tableResources,
+            final EventBus eventBus,
+            final ClientStorage clientStorage,
+            final MainTableHeaderlessResources headerlessResources,
+            final MainTableResources tableResources,
             final ApplicationConstants constants,
             final ApplicationResources resources) {
 
-        rootPanel = new SplitLayoutPanel();
+        SplitLayoutPanel rootPanel = createRootPanel();
+        macPoolTable = createMacPoolTable(sharedMacPoolModelProvider, 
eventBus, clientStorage, headerlessResources,
+                tableResources, constants, resources);
+
+        rootPanel.add(macPoolTable);
+        initWidget(rootPanel);
+    }
+
+    protected SplitLayoutPanel createRootPanel() {
+        SplitLayoutPanel rootPanel = new SplitLayoutPanel();
         rootPanel.setHeight("495px"); //$NON-NLS-1$
         rootPanel.setWidth("100%"); //$NON-NLS-1$
-        initWidget(rootPanel);
+        return rootPanel;
+    }
 
-        macPoolTable =
+    private SimpleActionTable<MacPool> createMacPoolTable(final 
SharedMacPoolModelProvider sharedMacPoolModelProvider,
+            final EventBus eventBus,
+            final ClientStorage clientStorage,
+            final MainTableHeaderlessResources headerlessResources,
+            final MainTableResources tableResources,
+            final ApplicationConstants constants,
+            final ApplicationResources resources) {
+
+        final SimpleActionTable<MacPool> macPoolTable =
                 new SimpleActionTable<MacPool>(sharedMacPoolModelProvider,
                         headerlessResources,
                         tableResources,
@@ -73,6 +90,7 @@
                 return sharedMacPoolModelProvider.getModel().getNewCommand();
             }
         });
+
         macPoolTable.addActionButton(new 
WebAdminButtonDefinition<MacPool>(constants.configureMacPoolEditButton()) {
 
             @Override
@@ -94,7 +112,8 @@
                 
sharedMacPoolModelProvider.setSelectedItems(macPoolTable.getSelectedItems());
             }
         });
-        rootPanel.add(macPoolTable);
+
+        return macPoolTable;
     }
 
 }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05d1ec1064eb3ec4ce17f88a2d532cb76aa4f39d
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to