Search in sources :

Example 1 with AssetsTenantPlace

use of org.openremote.app.client.assets.tenant.AssetsTenantPlace 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();
}
Also used : AssetBrowserSelection(org.openremote.app.client.assets.browser.AssetBrowserSelection) EventRegistration(org.openremote.model.event.bus.EventRegistration) AppActivity(org.openremote.app.client.mvp.AppActivity) EventBus(org.openremote.model.event.bus.EventBus) Environment(org.openremote.app.client.Environment) AssetBrowserSelection(org.openremote.app.client.assets.browser.AssetBrowserSelection) Collection(java.util.Collection) AssetViewPlace(org.openremote.app.client.assets.asset.AssetViewPlace) AssetsTenantPlace(org.openremote.app.client.assets.tenant.AssetsTenantPlace) AcceptsView(org.openremote.app.client.mvp.AcceptsView) Inject(javax.inject.Inject) AssetBrowser(org.openremote.app.client.assets.browser.AssetBrowser) AssetTreeNode(org.openremote.app.client.assets.browser.AssetTreeNode) TenantTreeNode(org.openremote.app.client.assets.browser.TenantTreeNode) AssetTreeNode(org.openremote.app.client.assets.browser.AssetTreeNode) AssetViewPlace(org.openremote.app.client.assets.asset.AssetViewPlace) TenantTreeNode(org.openremote.app.client.assets.browser.TenantTreeNode) AssetsTenantPlace(org.openremote.app.client.assets.tenant.AssetsTenantPlace)

Aggregations

Collection (java.util.Collection)1 Inject (javax.inject.Inject)1 Environment (org.openremote.app.client.Environment)1 AssetViewPlace (org.openremote.app.client.assets.asset.AssetViewPlace)1 AssetBrowser (org.openremote.app.client.assets.browser.AssetBrowser)1 AssetBrowserSelection (org.openremote.app.client.assets.browser.AssetBrowserSelection)1 AssetTreeNode (org.openremote.app.client.assets.browser.AssetTreeNode)1 TenantTreeNode (org.openremote.app.client.assets.browser.TenantTreeNode)1 AssetsTenantPlace (org.openremote.app.client.assets.tenant.AssetsTenantPlace)1 AcceptsView (org.openremote.app.client.mvp.AcceptsView)1 AppActivity (org.openremote.app.client.mvp.AppActivity)1 EventBus (org.openremote.model.event.bus.EventBus)1 EventRegistration (org.openremote.model.event.bus.EventRegistration)1