01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.model;
15:
16: import org.jetbrains.annotations.NotNull;
17: import org.pentaho.reportdesigner.crm.report.PropertyKeys;
18:
19: import java.beans.BeanDescriptor;
20: import java.beans.IntrospectionException;
21: import java.beans.PropertyDescriptor;
22: import java.beans.SimpleBeanInfo;
23:
24: /**
25: * User: Martin
26: * Date: 21.10.2005
27: * Time: 07:11:26
28: */
29: public class SubReportBeanInfo extends SimpleBeanInfo {
30: @NotNull
31: private PropertyDescriptor[] propertyDescriptors;
32:
33: public SubReportBeanInfo() throws IntrospectionException {
34: GroupingPropertyDescriptor nameDescriptor = new GroupingPropertyDescriptor(
35: PropertyKeys.NAME, PropertyKeys.GROUP_ID, false, 1,
36: SubReport.class);
37:
38: GroupingPropertyDescriptor pageDefinitionDescriptor = new GroupingPropertyDescriptor(
39: PropertyKeys.PAGE_DEFINITION,
40: PropertyKeys.GROUP_APPEARANCE, false, 1,
41: SubReport.class);
42: GroupingPropertyDescriptor defaultLocaleDescriptor = new GroupingPropertyDescriptor(
43: PropertyKeys.DEFAULT_LOCALE,
44: PropertyKeys.GROUP_APPEARANCE, false, 2,
45: SubReport.class);
46: GroupingPropertyDescriptor resourceBundleClasspathDescriptor = new GroupingPropertyDescriptor(
47: PropertyKeys.RESOURCE_BUNDLE_CLASSPATH,
48: PropertyKeys.GROUP_APPEARANCE, false, 3,
49: SubReport.class);
50: GroupingPropertyDescriptor useMaxCharBoundsDescriptor = new GroupingPropertyDescriptor(
51: PropertyKeys.USE_MAX_CHAR_BOUNDS,
52: PropertyKeys.GROUP_APPEARANCE, false, 4,
53: SubReport.class);
54: GroupingPropertyDescriptor queryDescriptor = new GroupingPropertyDescriptor(
55: PropertyKeys.QUERY, PropertyKeys.GROUP_APPEARANCE,
56: true, 5, SubReport.class);
57: GroupingPropertyDescriptor parametersDescriptor = new GroupingPropertyDescriptor(
58: PropertyKeys.PARAMETERS, PropertyKeys.GROUP_APPEARANCE,
59: true, 6, SubReport.class);
60:
61: propertyDescriptors = new PropertyDescriptor[] {
62: nameDescriptor, pageDefinitionDescriptor,
63: defaultLocaleDescriptor,
64: resourceBundleClasspathDescriptor, queryDescriptor,
65: useMaxCharBoundsDescriptor, parametersDescriptor };
66: }
67:
68: @NotNull
69: public BeanDescriptor getBeanDescriptor() {
70: return new BeanDescriptor(SubReport.class);
71: }
72:
73: @NotNull
74: public PropertyDescriptor[] getPropertyDescriptors() {
75: return propertyDescriptors;
76: }
77:
78: }
|