Alexander Wels has posted comments on this change.

Change subject: webadmin,userportal: Synchronize refresh.
......................................................................


Patch Set 4:

(12 comments)

....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/model/CommonModelManager.java
Line 20:      * Creates new {@link CommonModel} instance and sets up necessary 
event listeners.
Line 21:      * <p>
Line 22:      * Should be called right after successful user authentication, 
before redirecting the user to the main section.
Line 23:      */
Line 24:     public static void init(final EventBus eventBus) {
This is a static method.
Line 25:         commonModel = CommonModel.newInstance();
Line 26: 
Line 27:         commonModel.getSelectedItemChangedEvent().addListener(new 
IEventListener() {
Line 28:             @Override


....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/model/DataBoundTabModelProvider.java
Line 55:         // Add model items change handler
Line 56:         getModel().getItemsChangedEvent().addListener(new 
IEventListener() {
Line 57:             @Override
Line 58:             public void eventRaised(Event ev, Object sender, EventArgs 
args) {
Line 59:                 if (getCommonModel() != null && getModel() != null && 
handleItemsChangedEvent()) {
Done
Line 60:                     updateData();
Line 61:                 }
Line 62:             }
Line 63:         });


....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/model/TabModelProvider.java
Line 47:         eventBus.addHandler(CleanupModelEvent.getType(), new 
CleanupModelEvent.CleanupModelHandler() {
Line 48: 
Line 49:             @Override
Line 50:             public void onCleanupModel(CleanupModelEvent event) {
Line 51:                 if (getCommonModel() != null && getModel() != null) {
Done
Line 52:                     //Setting eventbus to null will also unregister 
the handlers.
Line 53:                     getModel().setEventBus(null);
Line 54:                 }
Line 55:             }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/EntityModel.java
Line 177:     /**
Line 178:      * Get the GWT event bus.
Line 179:      * @return The {@code EventBus}, can be null.
Line 180:      */
Line 181:     public EventBus getEventBus() {
Done
Line 182:         return eventBus;
Line 183:     }
Line 184: 
Line 185:     /**


Line 185:     /**
Line 186:      * Set the GWT event bus.
Line 187:      * @param eventBus The {@code EventBus}, can be null.
Line 188:      */
Line 189:     public void setEventBus(EventBus eventBus) {
Done
Line 190:         this.eventBus = eventBus;
Line 191:         if (eventBus == null) {
Line 192:             unregisterHandlers();
Line 193:         }


Line 196:     /**
Line 197:      * Register a handler.
Line 198:      * @param reg The {@code HandlerRegistration} returned from 
registering a handler.
Line 199:      */
Line 200:     public void registerHandler(HandlerRegistration reg) {
Done
Line 201:         if (reg != null && !handlerRegistrations.contains(reg)) {
Line 202:             handlerRegistrations.add(reg);
Line 203:         }
Line 204:     }


Line 205: 
Line 206:     /**
Line 207:      * Unregister all registered handlers.
Line 208:      */
Line 209:     public void unregisterHandlers() {
Done
Line 210:         for (HandlerRegistration reg: handlerRegistrations) {
Line 211:             reg.removeHandler(); // can't call unregisterHandler(reg) 
as that would modify the list during iteration
Line 212:         }
Line 213:         handlerRegistrations.clear();


Line 216:     /**
Line 217:      * Unregister a specific handler using its {@code 
HandlerRegistration}.
Line 218:      * @param reg The {@code HandlerRegistration} to use to remove 
the handler.
Line 219:      */
Line 220:     public void unregisterHandler(HandlerRegistration reg) {
Done
Line 221:         if (reg != null) {
Line 222:             reg.removeHandler();
Line 223:             handlerRegistrations.remove(reg);
Line 224:         }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java
Line 885:         return getListName();
Line 886:     }
Line 887: 
Line 888:     @Override
Line 889:     public void setEventBus(EventBus eventBus) {
Done
Line 890:         super.setEventBus(eventBus);
Line 891:         if (eventBus != null) {
Line 892:             //Register to listen for operation complete events.
Line 893:             
registerHandler(getEventBus().addHandler(RefreshActiveModelEvent.getType(),


Line 906:         }
Line 907:     }
Line 908: 
Line 909:     @Override
Line 910:     public void fireEvent(GwtEvent<?> event) {
Done
Line 911:         getEventBus().fireEvent(event);
Line 912:     }
Line 913: 


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/events/EventListModel.java
Line 235:         {
Line 236:             return;
Line 237:         }
Line 238: 
Line 239:         if (!source.isEmpty()) {
I think we do.
Line 240:             //We received some new events, tell the active models to 
update.
Line 241:             RefreshActiveModelEvent.fire(this, false);
Line 242:         }
Line 243:         List<AuditLog> list = (List<AuditLog>) getItems();


....................................................
File 
frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/system/ApplicationInit.java
Line 101:                     Window.Location.reload();
Line 102:                 }
Line 103: 
Line 104:                 frontend.clearLoggedInUser();
Line 105:                 ApplicationInit.super.performLogout();
Done
Line 106:                 connectAutomaticallyManager.resetAlreadyOpened();
Line 107:             }
Line 108:         };
Line 109: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaa59712f8f74426b0ca6a132664167f42fb8d7b2
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Einav Cohen <eco...@redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vsz...@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