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.tests.wrapper;
015:
016: import org.pentaho.reportdesigner.crm.report.model.ReportFunctionElement;
017: import org.pentaho.reportdesigner.lib.client.undo.ReflectionUndoEntry;
018:
019: @SuppressWarnings({"ALL"})
020: public class TestJFreeFunctionWrapper extends ReportFunctionElement {
021: //private String field;
022:
023: private double number;
024: private int intNumber;
025:
026: private boolean bool;
027: private long millis;
028:
029: private float hugo;
030:
031: private short shorty;
032:
033: private byte bla;
034:
035: private char character;
036:
037: public TestJFreeFunctionWrapper() {
038: }
039:
040: //public String getField()
041: //{
042: // return field;
043: //}
044: //
045: //
046: //public void setField(final String field)
047: //{
048: // final String oldField = this.field;
049: // this.field = field;
050: //
051: // if (getUndo() != null && !getUndo().isInProgress())
052: // {
053: // getUndo().startTransaction(PropertyKeys.FIELD);
054: // getUndo().add(new UndoEntry()
055: // {
056: // public void undo()
057: // {
058: // setField(oldField);
059: // }
060: //
061: //
062: // public void redo()
063: // {
064: // setField(field);
065: // }
066: // });
067: // getUndo().endTransaction();
068: // }
069: //
070: // firePropertyChange(PropertyKeys.FIELD, oldField, field);
071: //}
072:
073: public double getNumber() {
074: return number;
075: }
076:
077: public void setNumber(double number) {
078: double d = this .number;
079: this .number = number;
080: if (getUndo() != null && !getUndo().isInProgress()) {
081: getUndo().startTransaction("number");
082: getUndo().add(
083: new ReflectionUndoEntry(this , "setNumber",
084: Double.TYPE, Double.valueOf(d), Double
085: .valueOf(number)));
086: getUndo().endTransaction();
087: }
088: firePropertyChange("number", Double.valueOf(d), Double
089: .valueOf(number));
090: }
091:
092: public int getIntNumber() {
093: return intNumber;
094: }
095:
096: public void setIntNumber(int intNumber) {
097: int d = this .intNumber;
098: this .intNumber = intNumber;
099: if (getUndo() != null && !getUndo().isInProgress()) {
100: getUndo().startTransaction("intNumber");
101: getUndo().add(
102: new ReflectionUndoEntry(this , "setIntNumber",
103: Integer.TYPE, Integer.valueOf(d), Integer
104: .valueOf(intNumber)));
105: getUndo().endTransaction();
106: }
107: firePropertyChange("intNumber", Integer.valueOf(d), Integer
108: .valueOf(intNumber));
109: }
110:
111: public boolean isBool() {
112: return bool;
113: }
114:
115: public void setBool(boolean bool) {
116: boolean b = this .bool;
117: this .bool = bool;
118:
119: if (getUndo() != null && !getUndo().isInProgress()) {
120: getUndo().startTransaction("bool");
121: getUndo().add(
122: new ReflectionUndoEntry(this , "setBool",
123: Boolean.TYPE, Boolean.valueOf(b), Boolean
124: .valueOf(bool)));
125: getUndo().endTransaction();
126: }
127: firePropertyChange("bool", Boolean.valueOf(b), Boolean
128: .valueOf(bool));
129: }
130:
131: public long getMillis() {
132: return millis;
133: }
134:
135: public void setMillis(long millis) {
136: long m = this .millis;
137: this .millis = millis;
138:
139: if (getUndo() != null && !getUndo().isInProgress()) {
140: getUndo().startTransaction("millis");
141: getUndo().add(
142: new ReflectionUndoEntry(this , "setMillis",
143: Long.TYPE, Long.valueOf(m), Long
144: .valueOf(millis)));
145: getUndo().endTransaction();
146: }
147: firePropertyChange("millis", Long.valueOf(m), Long
148: .valueOf(millis));
149: }
150:
151: public float getHugo() {
152: return hugo;
153: }
154:
155: public void setHugo(float hugo) {
156: float h = this .hugo;
157: this .hugo = hugo;
158:
159: if (getUndo() != null && !getUndo().isInProgress()) {
160: getUndo().startTransaction("hugo");
161: getUndo().add(
162: new ReflectionUndoEntry(this , "setHugo",
163: Float.TYPE, Float.valueOf(h), Float
164: .valueOf(hugo)));
165: getUndo().endTransaction();
166: }
167: firePropertyChange("hugo", Float.valueOf(h), Float
168: .valueOf(hugo));
169: }
170:
171: public short getShorty() {
172: return shorty;
173: }
174:
175: public void setShorty(short shorty) {
176: short s = this .shorty;
177: this .shorty = shorty;
178:
179: if (getUndo() != null && !getUndo().isInProgress()) {
180: getUndo().startTransaction("shorty");
181: getUndo().add(
182: new ReflectionUndoEntry(this , "setShorty",
183: Short.TYPE, Short.valueOf(s), Short
184: .valueOf(shorty)));
185: getUndo().endTransaction();
186: }
187: firePropertyChange("shorty", Short.valueOf(s), Short
188: .valueOf(shorty));
189: }
190:
191: public byte getBla() {
192: return bla;
193: }
194:
195: public void setBla(byte bla) {
196: byte b = this .bla;
197: this .bla = bla;
198:
199: if (getUndo() != null && !getUndo().isInProgress()) {
200: getUndo().startTransaction("bla");
201: getUndo().add(
202: new ReflectionUndoEntry(this , "setBla", Byte.TYPE,
203: Byte.valueOf(b), Byte.valueOf(bla)));
204: getUndo().endTransaction();
205: }
206: firePropertyChange("bla", Byte.valueOf(b), Byte.valueOf(bla));
207: }
208:
209: public char getCharacter() {
210: return character;
211: }
212:
213: public void setCharacter(char character) {
214: char c = this .character;
215: this .character = character;
216:
217: if (getUndo() != null && !getUndo().isInProgress()) {
218: getUndo().startTransaction("character");
219: getUndo().add(
220: new ReflectionUndoEntry(this , "setCharacter",
221: Character.TYPE, Character.valueOf(c),
222: Character.valueOf(character)));
223: getUndo().endTransaction();
224: }
225: firePropertyChange("character", Character.valueOf(c), Character
226: .valueOf(character));
227: }
228: }
|