
org.ioc.commons.impl.gwt.client.globalflowcontroller.GwtGlobalFlowController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-gwt-impl Show documentation
Show all versions of ioc-commons-gwt-impl Show documentation
GWT implementation for ioc-commons artifacts.
package org.ioc.commons.impl.gwt.client.globalflowcontroller;
import org.ioc.commons.flowcontrol.actioncontroller.IsExternalAction;
import org.ioc.commons.flowcontrol.common.BindRegistration;
import org.ioc.commons.flowcontrol.eventbus.IsEvent;
import org.ioc.commons.flowcontrol.globalflowcontroller.GlobalFlowController;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.ui.IsWidget;
import com.google.gwt.event.logical.shared.AttachEvent;
import com.google.gwt.user.client.ui.Widget;
/**
* GWT implementation for {@link GlobalFlowController}
*
* @author Jesús Lunar Pérez
*
* @param
* Event type
* @param
* Operation type
* @param
* External action type
*/
public class GwtGlobalFlowController, O extends Enum extends IsOperation>, A extends Enum extends IsExternalAction>>
implements GlobalFlowController {
protected final GwtGlobalEventBusImpl eventbus;
protected final GwtGlobalOperationManagerImpl operationManager;
protected final GwtGlobalActionControllerImpl actionController;
public GwtGlobalFlowController(com.google.web.bindery.event.shared.EventBus eventBus) {
this.eventbus = new GwtGlobalEventBusImpl(eventBus, this);
this.operationManager = new GwtGlobalOperationManagerImpl(eventBus, this);
this.actionController = new GwtGlobalActionControllerImpl(eventBus, this);
}
final public GlobalEventBus eventBus() {
return this.eventbus;
}
final public GlobalOperationManager operationManager() {
return this.operationManager;
}
final public GlobalActionController actionController() {
return this.actionController;
}
static void unbindWhenDetach(final BindRegistration registration, IsWidget display) {
Widget w = (Widget) display.asWidget();
w.addAttachHandler(new AttachEvent.Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
if (!event.isAttached()) {
registration.unbind();
}
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy