Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Added button press handlers to HorizontalSplitTable
......................................................................

webadmin: Added button press handlers to HorizontalSplitTable

This would enable a developer to give react to down/up key pressed in
the widget on the model side.

Change-Id: I84666fbfa11afb976b35690483879fca860a9e21
Signed-off-by: Lior Vernia <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/HorizontalSplitTable.java
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/53/17453/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/HorizontalSplitTable.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/HorizontalSplitTable.java
index 33fed63..d5118ca 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/HorizontalSplitTable.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/HorizontalSplitTable.java
@@ -7,6 +7,7 @@
 import org.ovirt.engine.ui.common.CommonApplicationConstants;
 import org.ovirt.engine.ui.common.widget.dialog.SimpleDialogButton;
 import org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable;
+import org.ovirt.engine.ui.uicommonweb.UICommand;
 import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
 import org.ovirt.engine.ui.uicompat.Event;
@@ -41,6 +42,9 @@
 
     private IEventListener topItemsChangedListener;
     private IEventListener bottomItemsChangedListener;
+
+    private UICommand onDownButtonPressed;
+    private UICommand onUpButtonPressed;
 
     @UiField
     protected SimpleDialogButton downButton;
@@ -108,6 +112,11 @@
                 MultiSelectionModel<EntityModel> sourceSelectionModel = 
getSelectionModel(topTableIsSource);
                 EntityModelCellTable<ListModel> sourceTable = 
getTable(topTableIsSource);
                 EntityModelCellTable<ListModel> targetTable = 
getTable(!topTableIsSource);
+                UICommand command = topTableIsSource ? onDownButtonPressed : 
onUpButtonPressed;
+
+                if (command != null) {
+                    command.execute();
+                }
 
                 Set<EntityModel> selectedItems = 
sourceSelectionModel.getSelectedSet();
                 ((Collection<EntityModel>) 
sourceTable.asEditor().flush().getItems()).removeAll(selectedItems);
@@ -164,4 +173,13 @@
         edit(bottomListModel, false);
     }
 
+    public void edit(ListModel topListModel,
+            ListModel bottomListModel,
+            UICommand onDownButtonPressed,
+            UICommand onUpButtonPressed) {
+        edit(topListModel, bottomListModel);
+        this.onDownButtonPressed = onDownButtonPressed;
+        this.onUpButtonPressed = onUpButtonPressed;
+    }
+
 }


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

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

Reply via email to