01: package net.sourceforge.squirrel_sql.client.gui.mainframe;
02:
03: /*
04: * Copyright (C) 2001 Colin Bell
05: * colbell@users.sourceforge.net
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: */
21: import java.beans.BeanInfo;
22: import java.beans.Introspector;
23: import java.beans.IntrospectionException;
24: import java.beans.PropertyDescriptor;
25: import java.beans.SimpleBeanInfo;
26:
27: public class MainFrameWindowStateBeanInfo extends SimpleBeanInfo {
28: private static final Class<MainFrameWindowState> s_actualClass = MainFrameWindowState.class;
29:
30: /**
31: * If more than one thread is constructing, volatile tells them to check an
32: * otherwise cached value.
33: */
34: private static volatile PropertyDescriptor[] s_dscrs;
35:
36: public MainFrameWindowStateBeanInfo() throws IntrospectionException {
37: super ();
38: if (s_dscrs == null) {
39: s_dscrs = new PropertyDescriptor[2];
40: s_dscrs[0] = new PropertyDescriptor(
41: MainFrameWindowState.IPropertyNames.ALIASES_WINDOW_STATE,
42: s_actualClass, "getAliasesWindowState",
43: "setAliasesWindowState");
44: s_dscrs[1] = new PropertyDescriptor(
45: MainFrameWindowState.IPropertyNames.DRIVERS_WINDOW_STATE,
46: s_actualClass, "getDriversWindowState",
47: "setDriversWindowState");
48: }
49: }
50:
51: public BeanInfo[] getAdditionalBeanInfo() {
52: try {
53: BeanInfo super BeanInfo = Introspector
54: .getBeanInfo(s_actualClass.getSuperclass());
55: return new BeanInfo[] { super BeanInfo };
56: } catch (IntrospectionException ex) {
57: return new BeanInfo[0];
58: }
59: }
60:
61: public PropertyDescriptor[] getPropertyDescriptors() {
62: return s_dscrs;
63: }
64: }
|