use of org.openremote.app.client.assets.asset.AssetPlace 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");
}
}
Aggregations