use of org.openremote.model.event.bus.EventBus 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.EventBus 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