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