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