Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/eireneh/swing/TextViewPanelBeanInfo.java


1   
2   package com.eireneh.swing;
3   
4   import java.awt.*;
5   import java.beans.*;
6   
7   import com.eireneh.util.*;
8   
9   /**
10  * BeanInfo for the TextViewer. This was mostly generate using
11  * BeansExpress.
12  *
13  * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
14  * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
15  * Distribution Licence:<br />
16  * Project B is free software; you can redistribute it
17  * and/or modify it under the terms of the GNU General Public License,
18  * version 2 as published by the Free Software Foundation.<br />
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * General Public License for more details.<br />
23  * The License is available on the internet
24  * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
25  * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26  * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
27  * The copyright to this program is held by it's authors.
28  * </font></td></tr></table>
29  * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
30  * @see docs.Licence
31  * @author Joe Walker
32  */
33  public class TextViewPanelBeanInfo extends SimpleBeanInfo
34  {
35      /**
36      * Info about the extra properties we provide
37      * @return an array of property descriptors
38      */
39      public PropertyDescriptor[] getPropertyDescriptors()
40      {
41          try
42          {
43              // The header property
44              PropertyDescriptor header = new PropertyDescriptor("header",
45                                                                 TextViewPanel.class,
46                                                                 "getHeader",
47                                                                 "setHeader");
48              header.setDisplayName("Header");
49              header.setShortDescription("Header");
50              header.setBound(true);
51  
52              // The main text property
53              PropertyDescriptor text = new PropertyDescriptor("text",
54                                                               TextViewPanel.class,
55                                                               "getText",
56                                                               "setText");
57              text.setDisplayName("Text");
58              text.setShortDescription("Text");
59              text.setBound(true);
60  
61              return new PropertyDescriptor[] { header, text, };
62          }
63          catch (IntrospectionException ex)
64          {
65              log.log(Level.INFO, "Failure", ex);
66              return null;
67          }
68      }
69  
70      /**
71      * Get additional information from the superclass, in this case JPanel
72      */
73      public BeanInfo[] getAdditionalBeanInfo()
74      {
75          Class superclass = TextViewPanel.class.getSuperclass();
76          try
77          {
78              BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
79              return new BeanInfo[] { superBeanInfo };
80          }
81          catch (IntrospectionException ex)
82          {
83              log.log(Level.INFO, "Failure", ex);
84              return null;
85          }
86      }
87  
88      /** The log stream */
89      protected static Logger log = Logger.getLogger("util.swing");
90  }