com.github.nalukit.nalu.client.internal.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nalu Show documentation
Show all versions of nalu Show documentation
Routing based application framework for GWT 2, GWT 3 + J2CL
The newest version!
package com.github.nalukit.nalu.client.internal;
import com.github.nalukit.nalu.client.component.AbstractComponentController;
import com.github.nalukit.nalu.client.component.AbstractCompositeController;
public class Utils {
private static Utils instance;
private Utils() {
}
public static Utils get() {
if (instance == null) {
instance = new Utils();
}
return instance;
}
public void deactivateController(AbstractComponentController, ?, ?> controller,
boolean handlingModeReuse) {
// deactivate controller
controller.deactivate();
// remove handlers
controller.removeHandlers();
if (!handlingModeReuse) {
controller.onDetach();
controller.getComponent()
.onDetach();
}
}
public void stopController(AbstractComponentController, ?, ?> controller) {
controller.onDetach();
// stop controller
controller.stop();
// remove global handlers
controller.removeGlobalHandlers();
controller.onDetach();
controller.getComponent()
.onDetach();
// remove handlers on component elements
controller.getComponent()
.removeHandlers();
}
public void deactivateCompositeController(AbstractCompositeController, ?, ?> compositeController) {
compositeController.deactivate();
// remove handlers
compositeController.removeHandlers();
}
public void stopCompositeController(AbstractCompositeController, ?, ?> compositeController) {
if (!compositeController.isCached()) {
compositeController.stop();
// remove global handlers
compositeController.removeGlobalHandlers();
}
compositeController.onDetach();
compositeController.getComponent()
.onDetach();
// remove handlers on component elements
compositeController.getComponent()
.removeHandlers();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy