001    /*
002     * Copyright 2002-2004 the original author or authors.
003     * 
004     * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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     */
016    package org.springframework.richclient.command;
017    
018    import java.awt.Component;
019    import java.awt.Container;
020    
021    /**
022     * A strategy interface for adding components to an underlying {@link Container}.
023     * 
024     * @author Keith Donald
025     * 
026     * @see Container
027     */
028    public interface GroupContainerPopulator {
029        
030        /**
031         * Returns the underlying container that this instance is responsible for populating.
032         * 
033         * @return The underlying container, never null.
034         */
035        public Container getContainer();
036    
037        /**
038         * Adds the given component to the underlying container.
039         *
040         * @param component The component to be added. Must not be null.
041         * 
042         * @throws IllegalArgumentException if {@code component} is null.
043         */
044        public void add(Component component);
045    
046        /**
047         * Adds a separator to the underlying container.
048         */
049        public void addSeparator();
050    
051        /**
052         * Called to perform any required actions once the container has been populated.
053         */
054        public void onPopulated();
055        
056    }