001    /*
002     * $Id: JXCollapsiblePaneBeanInfo.java,v 1.3 2006/04/21 05:48:39 gfx Exp $
003     *
004     * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
005     * Santa Clara, California 95054, U.S.A. All rights reserved.
006     *
007     * This library is free software; you can redistribute it and/or
008     * modify it under the terms of the GNU Lesser General Public
009     * License as published by the Free Software Foundation; either
010     * version 2.1 of the License, or (at your option) any later version.
011     *
012     * This library is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015     * Lesser General Public License for more details.
016     *
017     * You should have received a copy of the GNU Lesser General Public
018     * License along with this library; if not, write to the Free Software
019     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
020     */
021    package org.jdesktop.swingx;
022    
023    import java.beans.BeanDescriptor;
024    
025    /**
026     * BeanInfo class for JXCollapsiblePane.
027     */
028    public class JXCollapsiblePaneBeanInfo extends BeanInfoSupport {
029        /** Constructor for the JXCollapsiblePaneBeanInfo object */
030        public JXCollapsiblePaneBeanInfo() {
031            super(JXCollapsiblePane.class);        
032        }
033        
034        protected void initialize() {
035            BeanDescriptor bd = getBeanDescriptor();
036            bd.setName("JXCollapsiblePane");
037            bd.setShortDescription("A pane which hides its content with an animation.");
038            bd.setValue("isContainer", Boolean.TRUE);
039            bd.setValue("containerDelegate", "getContentPane");
040            
041            setPreferred(true, "animated", "collapsed", "orientation");
042            setBound(true, "animated", "collapsed", "orientation");
043            
044    //        BeanInfo info = Introspector.getBeanInfo(getBeanDescriptor().getBeanClass().getSuperclass());
045    //        String order = info.getBeanDescriptor().getValue("propertyorder") == null ? "" : (String) info.getBeanDescriptor().getValue("propertyorder");
046    //        PropertyDescriptor[] pd = getPropertyDescriptors();
047    //        for (int i = 0; i != pd.length; i++) {
048    //            if (order.indexOf(pd[i].getName()) == -1) {
049    //                order = order + (order.length() == 0 ? "" : ":") + pd[i].getName();
050    //            }
051    //        }
052    //        getBeanDescriptor().setValue("propertyorder", order);
053        }
054    }