Search in sources :

Example 1 with AssetPlace

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");
    }
}
Also used : AssetEditPlace(org.openremote.app.client.assets.asset.AssetEditPlace) AssetViewPlace(org.openremote.app.client.assets.asset.AssetViewPlace) AssetPlace(org.openremote.app.client.assets.asset.AssetPlace)

Aggregations

AssetEditPlace (org.openremote.app.client.assets.asset.AssetEditPlace)1 AssetPlace (org.openremote.app.client.assets.asset.AssetPlace)1 AssetViewPlace (org.openremote.app.client.assets.asset.AssetViewPlace)1