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 NumberFieldReportElementBeanInfo extends SimpleBeanInfo {
030: @NotNull
031: private PropertyDescriptor[] propertyDescriptors;
032:
033: public NumberFieldReportElementBeanInfo()
034: throws IntrospectionException {
035: GroupingPropertyDescriptor nameDescriptor = new GroupingPropertyDescriptor(
036: PropertyKeys.NAME, PropertyKeys.GROUP_ID, false, 1,
037: NumberFieldReportElement.class);
038:
039: GroupingPropertyDescriptor positionContentDescriptor = new GroupingPropertyDescriptor(
040: PropertyKeys.POSITION, PropertyKeys.GROUP_SPATIAL,
041: false, 1, NumberFieldReportElement.class);
042: GroupingPropertyDescriptor minimumSizeContentDescriptor = new GroupingPropertyDescriptor(
043: PropertyKeys.MINIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
044: false, 2, NumberFieldReportElement.class);
045: GroupingPropertyDescriptor maximumSizeContentDescriptor = new GroupingPropertyDescriptor(
046: PropertyKeys.MAXIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
047: false, 3, NumberFieldReportElement.class);
048:
049: GroupingPropertyDescriptor formatStringDescriptor = new GroupingPropertyDescriptor(
050: PropertyKeys.FORMAT, PropertyKeys.GROUP_APPEARANCE,
051: true, 1, NumberFieldReportElement.class);
052: GroupingPropertyDescriptor fieldNameDescriptor = new GroupingPropertyDescriptor(
053: PropertyKeys.FIELD_NAME, PropertyKeys.GROUP_APPEARANCE,
054: true, 2, NumberFieldReportElement.class);
055: GroupingPropertyDescriptor nullStringDescriptor = new GroupingPropertyDescriptor(
056: PropertyKeys.NULL_STRING,
057: PropertyKeys.GROUP_APPEARANCE, true, 3,
058: NumberFieldReportElement.class);
059: GroupingPropertyDescriptor formulaDescriptor = new GroupingPropertyDescriptor(
060: PropertyKeys.FORMULA, PropertyKeys.GROUP_APPEARANCE,
061: false, 4, NumberFieldReportElement.class);
062: GroupingPropertyDescriptor styleExpressionsDescriptor = new GroupingPropertyDescriptor(
063: PropertyKeys.STYLE_EXPRESSIONS,
064: PropertyKeys.GROUP_APPEARANCE, false, 5,
065: NumberFieldReportElement.class);
066: GroupingPropertyDescriptor paddingContentDescriptor = new GroupingPropertyDescriptor(
067: PropertyKeys.PADDING, PropertyKeys.GROUP_APPEARANCE,
068: false, 6, NumberFieldReportElement.class);
069: GroupingPropertyDescriptor elementBorderDescriptor = new GroupingPropertyDescriptor(
070: PropertyKeys.ELEMENT_BORDER,
071: PropertyKeys.GROUP_APPEARANCE, false, 7,
072: NumberFieldReportElement.class);
073:
074: GroupingPropertyDescriptor fontDescriptor = new GroupingPropertyDescriptor(
075: PropertyKeys.FONT, PropertyKeys.GROUP_APPEARANCE,
076: false, 101, NumberFieldReportElement.class);
077: GroupingPropertyDescriptor underlineDescriptor = new GroupingPropertyDescriptor(
078: PropertyKeys.UNDERLINE, PropertyKeys.GROUP_APPEARANCE,
079: false, 102, NumberFieldReportElement.class);
080: GroupingPropertyDescriptor strikethroughDescriptor = new GroupingPropertyDescriptor(
081: PropertyKeys.STRIKETHROUGH,
082: PropertyKeys.GROUP_APPEARANCE, false, 103,
083: NumberFieldReportElement.class);
084: GroupingPropertyDescriptor lineHeightDescriptor = new GroupingPropertyDescriptor(
085: PropertyKeys.LINE_HEIGHT,
086: PropertyKeys.GROUP_APPEARANCE, false, 104,
087: NumberFieldReportElement.class);
088: GroupingPropertyDescriptor backgroundDescriptor = new GroupingPropertyDescriptor(
089: PropertyKeys.BACKGROUND, PropertyKeys.GROUP_APPEARANCE,
090: false, 105, NumberFieldReportElement.class);
091: GroupingPropertyDescriptor foregroundDescriptor = new GroupingPropertyDescriptor(
092: PropertyKeys.FOREGROUND, PropertyKeys.GROUP_APPEARANCE,
093: false, 106, NumberFieldReportElement.class);
094: GroupingPropertyDescriptor horizontalAlignmentDescriptor = new GroupingPropertyDescriptor(
095: PropertyKeys.HORIZONTAL_ALIGNMENT,
096: PropertyKeys.GROUP_APPEARANCE, false, 107,
097: NumberFieldReportElement.class);
098: GroupingPropertyDescriptor verticalAlignmentDescriptor = new GroupingPropertyDescriptor(
099: PropertyKeys.VERTICAL_ALIGNMENT,
100: PropertyKeys.GROUP_APPEARANCE, false, 108,
101: NumberFieldReportElement.class);
102: GroupingPropertyDescriptor reservedLiteralDescriptor = new GroupingPropertyDescriptor(
103: PropertyKeys.RESERVED_LITERAL,
104: PropertyKeys.GROUP_APPEARANCE, false, 109,
105: NumberFieldReportElement.class);
106: GroupingPropertyDescriptor trimTextContentDescriptor = new GroupingPropertyDescriptor(
107: PropertyKeys.TRIM_TEXT_CONTENT,
108: PropertyKeys.GROUP_APPEARANCE, false, 110,
109: NumberFieldReportElement.class);
110: GroupingPropertyDescriptor dynamicContentDescriptor = new GroupingPropertyDescriptor(
111: PropertyKeys.DYNAMIC_CONTENT,
112: PropertyKeys.GROUP_APPEARANCE, false, 111,
113: NumberFieldReportElement.class);
114:
115: GroupingPropertyDescriptor excelNumberFormatDescriptor = new GroupingPropertyDescriptor(
116: PropertyKeys.EXCEL_NUMBER_FORMAT,
117: PropertyKeys.GROUP_OUTPUT, true, 1,
118: NumberFieldReportElement.class);
119: GroupingPropertyDescriptor wrapTextInExcelDescriptor = new GroupingPropertyDescriptor(
120: PropertyKeys.WRAP_TEXT_IN_EXCEL,
121: PropertyKeys.GROUP_OUTPUT, false, 2,
122: NumberFieldReportElement.class);
123: GroupingPropertyDescriptor encodingDescriptor = new GroupingPropertyDescriptor(
124: PropertyKeys.ENCODING, PropertyKeys.GROUP_OUTPUT,
125: false, 3, NumberFieldReportElement.class);
126: GroupingPropertyDescriptor embedFontDescriptor = new GroupingPropertyDescriptor(
127: PropertyKeys.EMBED_FONT, PropertyKeys.GROUP_OUTPUT,
128: false, 4, NumberFieldReportElement.class);
129:
130: propertyDescriptors = new PropertyDescriptor[] {
131: nameDescriptor, styleExpressionsDescriptor,
132: formulaDescriptor, paddingContentDescriptor,
133: positionContentDescriptor, elementBorderDescriptor,
134: minimumSizeContentDescriptor,
135: maximumSizeContentDescriptor, formatStringDescriptor,
136: excelNumberFormatDescriptor, fieldNameDescriptor,
137: nullStringDescriptor, fontDescriptor,
138: underlineDescriptor, strikethroughDescriptor,
139: lineHeightDescriptor, backgroundDescriptor,
140: foregroundDescriptor, dynamicContentDescriptor,
141: horizontalAlignmentDescriptor,
142: verticalAlignmentDescriptor, reservedLiteralDescriptor,
143: trimTextContentDescriptor, wrapTextInExcelDescriptor,
144: encodingDescriptor, embedFontDescriptor };
145:
146: }
147:
148: @NotNull
149: public BeanDescriptor getBeanDescriptor() {
150: return new BeanDescriptor(NumberFieldReportElement.class);
151: }
152:
153: @NotNull
154: public PropertyDescriptor[] getPropertyDescriptors() {
155: return propertyDescriptors;
156: }
157:
158: }
|