1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.awt;
29 
30 import lib.MultiPropertyTest;
31 import util.utils;
32 
33 /**
34 * Testing <code>com.sun.star.awt.UnoControlCurrencyFieldModel</code>
35 * service properties :
36 * <ul>
37 *  <li><code> BackgroundColor</code></li>
38 *  <li><code> Border</code></li>
39 *  <li><code> CurrencySymbol</code></li>
40 *  <li><code> DecimalAccuracy</code></li>
41 *  <li><code> DefaultControl</code></li>
42 *  <li><code> Enabled</code></li>
43 *  <li><code> FontDescriptor</code></li>
44 *  <li><code> ShowThousandsSeparator</code></li>
45 *  <li><code> Printable</code></li>
46 *  <li><code> ReadOnly</code></li>
47 *  <li><code> Spin</code></li>
48 *  <li><code> StrictFormat</code></li>
49 *  <li><code> Tabstop</code></li>
50 *  <li><code> TextColor</code></li>
51 *  <li><code> Value</code></li>
52 *  <li><code> ValueMax</code></li>
53 *  <li><code> ValueMin</code></li>
54 *  <li><code> ValueStep</code></li>
55 * </ul>
56 * @see com.sun.star.awt.UnoControlCurrencyFieldModel
57 */
58 public class _UnoControlCurrencyFieldModel extends MultiPropertyTest {
59 
60     /**
61     * This property can be void, so if old value is <code> null </code>
62     * new value must be specified.
63     */
64     public void _BackgroundColor() {
65         testProperty("BackgroundColor", new PropertyTester() {
66             protected Object getNewValue(String prop, Object old) {
67                 return utils.isVoid(old) ? new Integer(6543) : null ;
68             }
69         }) ;
70     }
71 
72     /**
73     * This property can be void, so if old value is <code> null </code>
74     * new value must be specified.
75     */
76     public void _Tabstop() {
77         testProperty("Tabstop", new PropertyTester() {
78             protected Object getNewValue(String prop, Object old) {
79                 return utils.isVoid(old) ? new Boolean(true) : null ;
80             }
81         }) ;
82     }
83 
84     /**
85     * This property can be VOID, and in case if it is so new
86     * value must defined.
87     */
88     public void _BorderColor() {
89         testProperty("BorderColor", new PropertyTester() {
90             protected Object getNewValue(String p, Object old) {
91                 return utils.isVoid(old) ? new Integer(1234) : null ;
92             }
93         }) ;
94     }
95 
96     /**
97     * This property can be void, so if old value is <code> null </code>
98     * new value must be specified.
99     */
100     public void _TextColor() {
101         testProperty("TextColor", new PropertyTester() {
102             protected Object getNewValue(String prop, Object old) {
103                 return utils.isVoid(old) ? new Integer(123) : null ;
104             }
105         }) ;
106     }
107 
108     /**
109     * This property can be void, so if old value is <code> null </code>
110     * new value must be specified.
111     */
112     public void _TextLineColor() {
113         testProperty("TextLineColor", new PropertyTester() {
114             protected Object getNewValue(String prop, Object old) {
115                 return utils.isVoid(old) ? new Integer(123) : null ;
116             }
117         }) ;
118     }
119 
120     /**
121     * This property can be void, so if old value is <code> null </code>
122     * new value must be specified.
123     */
124     public void _Value() {
125         testProperty("Value", new PropertyTester() {
126             protected Object getNewValue(String prop, Object old) {
127                 return utils.isVoid(old) ? new Double(777) :
128                     super.getNewValue(prop, old) ;
129             }
130         }) ;
131     }
132 }
133 
134