Search in sources :

Example 1 with AdminUserNotificationsPlace

use of org.openremote.app.client.admin.users.notifications.AdminUserNotificationsPlace in project openremote by openremote.

the class AdminUsersNavigation method setActive.

public void setActive(AbstractAdminUsersPlace place) {
    reset();
    if (place.getRealm() != null) {
        allUsersLink.setTargetHistoryToken(placeHistoryMapper.getToken(new AdminUsersPlace(place.getRealm())));
        allUsersLink.setVisible(true);
        createUserLink.setTargetHistoryToken(placeHistoryMapper.getToken(new AdminUserEditPlace(place.getRealm())));
        createUserLink.setVisible(true);
    } else {
        allUsersLink.setVisible(false);
        createUserLink.setVisible(false);
    }
    editUserLink.setTargetHistoryToken(placeHistoryMapper.getToken(new AdminUserEditPlace(place)));
    if (place instanceof AdminUserEditPlace) {
        AdminUserEditPlace adminUserEditPlace = (AdminUserEditPlace) place;
        if (adminUserEditPlace.getUserId() == null) {
            createUserLink.addStyleName("active");
            createUserLink.setVisible(true);
        } else {
            editUserLink.addStyleName("active");
            editUserLink.setVisible(true);
            notificationsLink.setTargetHistoryToken(placeHistoryMapper.getToken(new AdminUserNotificationsPlace(place)));
            notificationsLink.setVisible(true);
        }
    } else if (place instanceof AdminUserNotificationsPlace) {
        createUserLink.setVisible(true);
        editUserLink.setVisible(true);
        notificationsLink.addStyleName("active");
        notificationsLink.setVisible(true);
    } else if (place instanceof AdminUsersPlace) {
        allUsersLink.setVisible(false);
    }
}
Also used : AdminUserNotificationsPlace(org.openremote.app.client.admin.users.notifications.AdminUserNotificationsPlace) AdminUserEditPlace(org.openremote.app.client.admin.users.edit.AdminUserEditPlace)

Aggregations

AdminUserEditPlace (org.openremote.app.client.admin.users.edit.AdminUserEditPlace)1 AdminUserNotificationsPlace (org.openremote.app.client.admin.users.notifications.AdminUserNotificationsPlace)1