use of org.openremote.model.event.bus.EventRegistration in project openremote by openremote.
the class Simulator method createSimulator.
protected void createSimulator() {
eventRegistration = environment.getEventBus().register(SimulatorState.class, simulatorState -> {
if (!simulatorState.getProtocolConfigurationRef().equals(protocolConfiguration))
return;
this.simulatorState = simulatorState;
writeView();
});
environment.getEventService().dispatch(new RequestSimulatorState(protocolConfiguration));
onCreate.run();
}
use of org.openremote.model.event.bus.EventRegistration in project openremote by openremote.
the class AssetsDashboardActivity method start.
@Override
public void start(AcceptsView container, EventBus eventBus, Collection<EventRegistration> registrations) {
view.setPresenter(this);
container.setWidget(view.asWidget());
registrations.add(eventBus.register(AssetBrowserSelection.class, event -> {
if (event.getSelectedNode() instanceof TenantTreeNode) {
environment.getPlaceController().goTo(new AssetsTenantPlace(event.getSelectedNode().getId()));
} else if (event.getSelectedNode() instanceof AssetTreeNode) {
environment.getPlaceController().goTo(new AssetViewPlace(event.getSelectedNode().getId()));
}
}));
assetBrowserPresenter.clearSelection();
}
use of org.openremote.model.event.bus.EventRegistration in project openremote by openremote.
the class AssetsTenantActivity method start.
@Override
public void start(AcceptsView container, EventBus eventBus, Collection<EventRegistration> registrations) {
view.setPresenter(this);
container.setWidget(view.asWidget());
registrations.add(eventBus.register(AssetBrowserSelection.class, event -> {
if (event.getSelectedNode() instanceof TenantTreeNode) {
if (this.realmId == null || !this.realmId.equals(event.getSelectedNode().getId())) {
environment.getPlaceController().goTo(new AssetsTenantPlace(event.getSelectedNode().getId()));
}
} else if (event.getSelectedNode() instanceof AssetTreeNode) {
environment.getPlaceController().goTo(new AssetViewPlace(event.getSelectedNode().getId()));
}
}));
loadTenant();
}
Aggregations