001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.uif.container;
017
018import org.kuali.rice.krad.uif.component.Component;
019import org.kuali.rice.krad.uif.widget.Reorderer;
020
021import java.util.List;
022
023/**
024 * Group implementation that supports reordering of the group items
025 *
026 * <p>
027 * Uses a {@link org.kuali.rice.krad.uif.widget.Reorderer} widget to perform the reordering client side
028 * </p>
029 *
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 */
032public class ReorderingGroup extends Group {
033    private static final long serialVersionUID = -9069458348367183223L;
034
035    private Reorderer reorderer;
036
037    public ReorderingGroup() {
038        super();
039    }
040
041    /**
042     * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
043     */
044    @Override
045    public List<Component> getComponentsForLifecycle() {
046        List<Component> components = super.getComponentsForLifecycle();
047
048        components.add(reorderer);
049
050        return components;
051    }
052
053    /**
054     * Widget that will perform the reordering of the group's items client side
055     *
056     * @return Reorderer widget instance
057     */
058    public Reorderer getReorderer() {
059        return reorderer;
060    }
061
062    /**
063     * Setter for the groups reorderer widget
064     *
065     * @param reorderer
066     */
067    public void setReorderer(Reorderer reorderer) {
068        this.reorderer = reorderer;
069    }
070}