001: /*
002: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
007: *
008: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
009: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
010: * the license for the specific language governing your rights and limitations.
011: *
012: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
013: */
014: package org.pentaho.reportdesigner.crm.report.model;
015:
016: import org.jetbrains.annotations.NotNull;
017: import org.pentaho.reportdesigner.crm.report.PropertyKeys;
018:
019: import java.beans.BeanDescriptor;
020: import java.beans.IntrospectionException;
021: import java.beans.PropertyDescriptor;
022: import java.beans.SimpleBeanInfo;
023:
024: /**
025: * User: Martin
026: * Date: 21.10.2005
027: * Time: 07:11:26
028: */
029: public class ResourceFieldReportElementBeanInfo extends SimpleBeanInfo {
030: @NotNull
031: private PropertyDescriptor[] propertyDescriptors;
032:
033: public ResourceFieldReportElementBeanInfo()
034: throws IntrospectionException {
035: GroupingPropertyDescriptor nameDescriptor = new GroupingPropertyDescriptor(
036: PropertyKeys.NAME, PropertyKeys.GROUP_ID, false, 1,
037: ResourceFieldReportElement.class);
038:
039: GroupingPropertyDescriptor positionContentDescriptor = new GroupingPropertyDescriptor(
040: PropertyKeys.POSITION, PropertyKeys.GROUP_SPATIAL,
041: false, 1, ResourceFieldReportElement.class);
042: GroupingPropertyDescriptor minimumSizeContentDescriptor = new GroupingPropertyDescriptor(
043: PropertyKeys.MINIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
044: false, 2, ResourceFieldReportElement.class);
045: GroupingPropertyDescriptor maximumSizeContentDescriptor = new GroupingPropertyDescriptor(
046: PropertyKeys.MAXIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
047: false, 3, ResourceFieldReportElement.class);
048:
049: GroupingPropertyDescriptor resourceBaseStringDescriptor = new GroupingPropertyDescriptor(
050: PropertyKeys.RESOURCE_BASE,
051: PropertyKeys.GROUP_APPEARANCE, true, 1,
052: ResourceFieldReportElement.class);
053: GroupingPropertyDescriptor fieldNameDescriptor = new GroupingPropertyDescriptor(
054: PropertyKeys.FIELD_NAME, PropertyKeys.GROUP_APPEARANCE,
055: true, 2, ResourceFieldReportElement.class);
056: GroupingPropertyDescriptor nullStringDescriptor = new GroupingPropertyDescriptor(
057: PropertyKeys.NULL_STRING,
058: PropertyKeys.GROUP_APPEARANCE, true, 3,
059: ResourceFieldReportElement.class);
060: GroupingPropertyDescriptor formulaDescriptor = new GroupingPropertyDescriptor(
061: PropertyKeys.FORMULA, PropertyKeys.GROUP_APPEARANCE,
062: false, 4, ResourceFieldReportElement.class);
063: GroupingPropertyDescriptor styleExpressionsDescriptor = new GroupingPropertyDescriptor(
064: PropertyKeys.STYLE_EXPRESSIONS,
065: PropertyKeys.GROUP_APPEARANCE, false, 5,
066: ResourceFieldReportElement.class);
067:
068: GroupingPropertyDescriptor fontDescriptor = new GroupingPropertyDescriptor(
069: PropertyKeys.FONT, PropertyKeys.GROUP_APPEARANCE,
070: false, 101, ResourceFieldReportElement.class);
071: GroupingPropertyDescriptor underlineDescriptor = new GroupingPropertyDescriptor(
072: PropertyKeys.UNDERLINE, PropertyKeys.GROUP_APPEARANCE,
073: false, 102, ResourceFieldReportElement.class);
074: GroupingPropertyDescriptor strikethroughDescriptor = new GroupingPropertyDescriptor(
075: PropertyKeys.STRIKETHROUGH,
076: PropertyKeys.GROUP_APPEARANCE, false, 103,
077: ResourceFieldReportElement.class);
078: GroupingPropertyDescriptor lineHeightDescriptor = new GroupingPropertyDescriptor(
079: PropertyKeys.LINE_HEIGHT,
080: PropertyKeys.GROUP_APPEARANCE, false, 104,
081: ResourceFieldReportElement.class);
082: GroupingPropertyDescriptor backgroundDescriptor = new GroupingPropertyDescriptor(
083: PropertyKeys.BACKGROUND, PropertyKeys.GROUP_APPEARANCE,
084: false, 105, ResourceFieldReportElement.class);
085: GroupingPropertyDescriptor foregroundDescriptor = new GroupingPropertyDescriptor(
086: PropertyKeys.FOREGROUND, PropertyKeys.GROUP_APPEARANCE,
087: false, 106, ResourceFieldReportElement.class);
088: GroupingPropertyDescriptor horizontalAlignmentDescriptor = new GroupingPropertyDescriptor(
089: PropertyKeys.HORIZONTAL_ALIGNMENT,
090: PropertyKeys.GROUP_APPEARANCE, false, 107,
091: ResourceFieldReportElement.class);
092: GroupingPropertyDescriptor verticalAlignmentDescriptor = new GroupingPropertyDescriptor(
093: PropertyKeys.VERTICAL_ALIGNMENT,
094: PropertyKeys.GROUP_APPEARANCE, false, 108,
095: ResourceFieldReportElement.class);
096: GroupingPropertyDescriptor reservedLiteralDescriptor = new GroupingPropertyDescriptor(
097: PropertyKeys.RESERVED_LITERAL,
098: PropertyKeys.GROUP_APPEARANCE, false, 109,
099: ResourceFieldReportElement.class);
100: GroupingPropertyDescriptor trimTextContentDescriptor = new GroupingPropertyDescriptor(
101: PropertyKeys.TRIM_TEXT_CONTENT,
102: PropertyKeys.GROUP_APPEARANCE, false, 110,
103: ResourceFieldReportElement.class);
104: GroupingPropertyDescriptor dynamicContentDescriptor = new GroupingPropertyDescriptor(
105: PropertyKeys.DYNAMIC_CONTENT,
106: PropertyKeys.GROUP_APPEARANCE, false, 111,
107: ResourceFieldReportElement.class);
108: GroupingPropertyDescriptor paddingContentDescriptor = new GroupingPropertyDescriptor(
109: PropertyKeys.PADDING, PropertyKeys.GROUP_APPEARANCE,
110: false, 112, ResourceFieldReportElement.class);
111: GroupingPropertyDescriptor elementBorderDescriptor = new GroupingPropertyDescriptor(
112: PropertyKeys.ELEMENT_BORDER,
113: PropertyKeys.GROUP_APPEARANCE, false, 113,
114: ResourceFieldReportElement.class);
115:
116: GroupingPropertyDescriptor wrapTextInExcelDescriptor = new GroupingPropertyDescriptor(
117: PropertyKeys.WRAP_TEXT_IN_EXCEL,
118: PropertyKeys.GROUP_OUTPUT, false, 1,
119: ResourceFieldReportElement.class);
120: GroupingPropertyDescriptor encodingDescriptor = new GroupingPropertyDescriptor(
121: PropertyKeys.ENCODING, PropertyKeys.GROUP_OUTPUT,
122: false, 2, ResourceFieldReportElement.class);
123: GroupingPropertyDescriptor embedFontDescriptor = new GroupingPropertyDescriptor(
124: PropertyKeys.EMBED_FONT, PropertyKeys.GROUP_OUTPUT,
125: false, 3, ResourceFieldReportElement.class);
126:
127: propertyDescriptors = new PropertyDescriptor[] {
128: nameDescriptor, styleExpressionsDescriptor,
129: positionContentDescriptor, formulaDescriptor,
130: elementBorderDescriptor, paddingContentDescriptor,
131: minimumSizeContentDescriptor,
132: maximumSizeContentDescriptor,
133: resourceBaseStringDescriptor, fieldNameDescriptor,
134: nullStringDescriptor, fontDescriptor,
135: underlineDescriptor, strikethroughDescriptor,
136: lineHeightDescriptor, backgroundDescriptor,
137: foregroundDescriptor, dynamicContentDescriptor,
138: horizontalAlignmentDescriptor,
139: verticalAlignmentDescriptor, reservedLiteralDescriptor,
140: trimTextContentDescriptor, wrapTextInExcelDescriptor,
141: encodingDescriptor, embedFontDescriptor };
142:
143: }
144:
145: @NotNull
146: public BeanDescriptor getBeanDescriptor() {
147: return new BeanDescriptor(ResourceFieldReportElement.class);
148: }
149:
150: @NotNull
151: public PropertyDescriptor[] getPropertyDescriptors() {
152: return propertyDescriptors;
153: }
154:
155: }
|