use of org.openremote.app.client.assets.asset.AssetViewPlace in project openremote by openremote.
the class AssetNavigationImpl method setPresenter.
@Override
public void setPresenter(Presenter presenter) {
this.presenter = presenter;
viewAssetLink.removeStyleName("active");
editAssetLink.removeStyleName("active");
if (presenter == null) {
navItemContainer.clear();
viewAssetLink.setTargetHistoryToken("");
editAssetLink.setTargetHistoryToken("");
return;
}
viewAssetLink.setTargetHistoryToken(presenter.getAssetViewPlaceToken());
editAssetLink.setTargetHistoryToken(presenter.getAssetEditPlaceToken());
AssetPlace place = presenter.getActivePlace();
if (place instanceof AssetViewPlace) {
viewAssetLink.addStyleName("active");
} else if (place instanceof AssetEditPlace) {
editAssetLink.addStyleName("active");
}
}
use of org.openremote.app.client.assets.asset.AssetViewPlace 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.app.client.assets.asset.AssetViewPlace 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