Package org.geoserver.security.web.usergroup

Source Code of org.geoserver.security.web.usergroup.UserGroupServicesTogglePanel

/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.security.web.usergroup;

import org.apache.wicket.model.IModel;
import org.geoserver.security.config.SecurityUserGroupServiceConfig;
import org.geoserver.security.web.SecurityNamedServicesTogglePanel;
import org.geoserver.security.web.group.GroupPanel;
import org.geoserver.security.web.user.UserPanel;

/**
* Toggle panel for user group services.
*
* @author Justin Deoliveira, OpenGeo
*/
public class UserGroupServicesTogglePanel
    extends SecurityNamedServicesTogglePanel<SecurityUserGroupServiceConfig> {

    public UserGroupServicesTogglePanel(String id) {
        super(id, new UserGroupServiceConfigListModel());
    }

    @Override
    protected ContentPanel createPanel(String id, IModel<SecurityUserGroupServiceConfig> model) {
        return new UsersGroupsPanel(id, model);
    }

    static class UsersGroupsPanel extends ContentPanel<SecurityUserGroupServiceConfig> {

        public UsersGroupsPanel(String id, final IModel<SecurityUserGroupServiceConfig> model) {
            super(id, model);

            SecurityUserGroupServiceConfig config = model.getObject();
            add(new UserPanel("users", config.getName())
                .setHeaderVisible(true).setPagersVisible(false, true));
            add(new GroupPanel("groups", config.getName())
                .setHeaderVisible(true).setPagersVisible(false, true));
        }
    }
}
TOP

Related Classes of org.geoserver.security.web.usergroup.UserGroupServicesTogglePanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.