KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > config > ConfigModuleBeanInfo


1 /* ************************************************************************** *
2  * Copyright (C) 2004 NightLabs GmbH, Marco Schulze *
3  * All rights reserved. *
4  * http://www.NightLabs.de *
5  * *
6  * This program and the accompanying materials are free software; you can re- *
7  * distribute it and/or modify it under the terms of the GNU General Public *
8  * License as published by the Free Software Foundation; either ver 2 of the *
9  * License, or any later version. *
10  * *
11  * This module is distributed in the hope that it will be useful, but WITHOUT *
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT- *
13  * NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more *
14  * details. *
15  * *
16  * You should have received a copy of the GNU General Public License along *
17  * with this module; if not, write to the Free Software Foundation, Inc.: *
18  * 59 Temple Place, Suite 330 *
19  * Boston MA 02111-1307 *
20  * USA *
21  * *
22  * Or get it online: *
23  * http://www.opensource.org/licenses/gpl-license.php *
24  * *
25  * In case, you want to use this module or parts of it in a proprietary pro- *
26  * ject, you can purchase it under the NightLabs Commercial License. Please *
27  * contact NightLabs GmbH under info AT nightlabs DOT com for more infos or *
28  * visit http://www.NightLabs.com *
29  * ************************************************************************** */

30
31 package com.nightlabs.config;
32
33 import java.beans.IntrospectionException JavaDoc;
34 import java.beans.PropertyDescriptor JavaDoc;
35 import java.beans.SimpleBeanInfo JavaDoc;
36
37 import org.apache.log4j.Logger;
38
39 public class ConfigModuleBeanInfo
40 extends SimpleBeanInfo JavaDoc
41 {
42   public static final Logger LOGGER = Logger.getLogger(ConfigModuleBeanInfo.class);
43     
44   Class JavaDoc beanClass = ConfigModule.class;
45
46   private static final int PROPERTY_identifier = 0;
47   private static final int PROPERTY_searchClass = 1;
48  
49   public PropertyDescriptor JavaDoc[] getPropertyDescriptors()
50   {
51     PropertyDescriptor JavaDoc[] properties = new PropertyDescriptor JavaDoc[2];
52     
53     try {
54 // properties[PROPERTY_identifier] = new PropertyDescriptor ( "identifier", beanClass, "getIdentifier", "setIdentifier" );
55
// properties[PROPERTY_identifier].setHidden(true);
56
// properties[PROPERTY_searchClass] = new PropertyDescriptor ( "searchClass", beanClass, "getSearchClass", "setSearchClass" );
57
// properties[PROPERTY_searchClass].setHidden(true);
58
properties[PROPERTY_identifier] = new PropertyDescriptor JavaDoc ( "identifier", beanClass, null, null );
59         properties[PROPERTY_searchClass] = new PropertyDescriptor JavaDoc ( "searchClass", beanClass, null, null );
60     }
61     catch( IntrospectionException JavaDoc e) {
62         LOGGER.error("", e);
63     }
64     
65     // Here you can add code for customizing the properties array.
66
return properties;
67   }
68   
69 }
70
Popular Tags