Save This Page
Home » openjdk-7 » net.sf.raptor » ui » testdata » [javadoc | source]
    1   /*********************************************************************************
    2    *                                                                               *
    3    * Raptor - Rapid prototyping of Swing GUIs based on JavaBeans like Java objects *
    4    * Copyright (C) 2003  XCOM AG                                                   *
    5    *                                                                               *
    6    * This library is free software; you can redistribute it and/or                 *
    7    * modify it under the terms of the GNU Lesser General Public                    *
    8    * License as published by the Free Software Foundation; either                  *
    9    * version 2.1 of the License, or (at your option) any later version.            *
   10    *                                                                               *
   11    * This library is distributed in the hope that it will be useful,               *
   12    * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
   13    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
   14    * Lesser General Public License for more details.                               *
   15    *                                                                               *
   16    * You should have received a copy of the GNU Lesser General Public              *
   17    * License along with this library; if not, write to the Free Software           *
   18    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA     *
   19    *                                                                               *
   20    *********************************************************************************/
   21   package net.sf.raptor.ui.testdata;
   22   
   23   import java.beans.MethodDescriptor;
   24   import java.util.ArrayList;
   25   import java.util.List;
   26   
   27   import javax.swing.BorderFactory;
   28   import javax.swing.BoxLayout;
   29   import javax.swing.JDialog;
   30   import javax.swing.JPanel;
   31   
   32   import net.sf.raptor.ui.WindowUtils;
   33   import net.sf.raptor.ui.panels.BeanEditPanel;
   34   
   35   
   36   /**
   37    * @author XCOM AG
   38    *
   39    * To change the template for this generated type comment go to
   40    * Window>Preferences>Java>Code Generation>Code and Comments
   41    */
   42   public class TestUtils {
   43   	
   44   	public static List createTestBeanPersonList() {
   45   		List list = new ArrayList();
   46   		list.add( new TestBeanPerson(1,"huhu") );
   47   		list.add( new TestBeanPerson(2,"hoho") );
   48   		list.add( new TestBeanPerson(3,"hihi") );
   49   		list.add( new TestBeanPerson(4,"h?h?") );
   50   		list.add( new TestBeanPerson(5,"h?h?") );
   51   		list.add( new TestBeanPerson(6,"hoioioioii") );
   52   		return list;
   53   	}
   54   	
   55   	public static void describeMethods( MethodDescriptor[] methodDescriptors ) {
   56   		JPanel panel = new JPanel();
   57   		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
   58   		for (int i = 0; i < methodDescriptors.length; i++) {
   59   			BeanEditPanel bPanel = new BeanEditPanel(methodDescriptors[i]);
   60   			bPanel.updateUI();
   61   			bPanel.setBorder( BorderFactory.createEtchedBorder() );
   62   			panel.add(bPanel);			
   63   		}
   64   		JDialog dialog = WindowUtils.wrapInDialog(panel);
   65   		dialog.pack();
   66   		WindowUtils.doModal( dialog );
   67   	}
   68   	
   69   }

Save This Page
Home » openjdk-7 » net.sf.raptor » ui » testdata » [javadoc | source]