001    /*
002      Copyright (C) 2002 Renaud Pawlak, Laurent Martelli
003      
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program is distributed in the hope that it will be useful,
010      but WITHOUT ANY WARRANTY; without even the implied warranty of
011      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public License
015      along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
017    
018    package org.objectweb.jac.aspects.gui;
019    
020    import java.util.Collection;
021    
022    /**
023     * This view is a composite view (i.e. a view that can contains other
024     * view). View and CompositeView follow the GoF composite pattern. */
025    
026    public interface CompositeView extends View {
027        /**
028         * Adds a component view in the composite.
029         *
030         * @param component the component view
031         * @param extraInfos some positionning infos on where the component
032         * should be added in the composite 
033         */
034        void addView(View component, Object extraInfos);
035    
036        /**
037         * Adds a component view in the composite.
038         *
039         * @param component the component view 
040         */
041        void addView(View component);
042    
043        /**
044         * Adds an horizontal separator in the composite in order to insert
045         * blanks between components. 
046         */
047        void addHorizontalStrut(int width);
048    
049        /**
050         * Adds a vertical separator in the composite in order to insert
051         * blanks between components. 
052         */
053        void addVerticalStrut(int height);
054    
055        /**
056         * Gets a component view from an id object. 
057         */
058        View getView(Object id);
059    
060        /**
061         * Gets all the component views in this composite. 
062         */
063        Collection getViews();
064    
065        /**
066         * Tells wether the composite view contains a view with some given
067         * view type and paramters
068         *
069         * @param viewType the type of the view to look for
070         * @param parameters the parameters of the view to look for
071         * @return true if the composite contains a view with the given
072         * type and parameters
073         */
074        boolean containsView(String viewType, Object[] parameters);
075    
076        /**
077         * Removes a component view in this composite.
078         *
079         * @param component the component view to remove
080         * @param validate wether to validate values in editors
081         */
082        void removeView(View component, boolean validate);
083    
084        /**
085         * Removes all the views in this composite. 
086         *
087         * @param validate wether to validate values in editors
088         */
089        void removeAllViews(boolean validate);
090    }