1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.awt;
25 
26 import lib.MultiPropertyTest;
27 import util.utils;
28 
29 /**
30 * Testing <code>com.sun.star.awt.UnoControlCurrencyFieldModel</code>
31 * service properties :
32 * <ul>
33 *  <li><code> BackgroundColor</code></li>
34 *  <li><code> Border</code></li>
35 *  <li><code> CurrencySymbol</code></li>
36 *  <li><code> DecimalAccuracy</code></li>
37 *  <li><code> DefaultControl</code></li>
38 *  <li><code> Enabled</code></li>
39 *  <li><code> FontDescriptor</code></li>
40 *  <li><code> ShowThousandsSeparator</code></li>
41 *  <li><code> Printable</code></li>
42 *  <li><code> ReadOnly</code></li>
43 *  <li><code> Spin</code></li>
44 *  <li><code> StrictFormat</code></li>
45 *  <li><code> Tabstop</code></li>
46 *  <li><code> TextColor</code></li>
47 *  <li><code> Value</code></li>
48 *  <li><code> ValueMax</code></li>
49 *  <li><code> ValueMin</code></li>
50 *  <li><code> ValueStep</code></li>
51 * </ul>
52 * @see com.sun.star.awt.UnoControlCurrencyFieldModel
53 */
54 public class _UnoControlCurrencyFieldModel extends MultiPropertyTest {
55 
56     /**
57     * This property can be void, so if old value is <code> null </code>
58     * new value must be specified.
59     */
_BackgroundColor()60     public void _BackgroundColor() {
61         testProperty("BackgroundColor", new PropertyTester() {
62             protected Object getNewValue(String prop, Object old) {
63                 return utils.isVoid(old) ? new Integer(6543) : null ;
64             }
65         }) ;
66     }
67 
68     /**
69     * This property can be void, so if old value is <code> null </code>
70     * new value must be specified.
71     */
_Tabstop()72     public void _Tabstop() {
73         testProperty("Tabstop", new PropertyTester() {
74             protected Object getNewValue(String prop, Object old) {
75                 return utils.isVoid(old) ? new Boolean(true) : null ;
76             }
77         }) ;
78     }
79 
80     /**
81     * This property can be VOID, and in case if it is so new
82     * value must defined.
83     */
_BorderColor()84     public void _BorderColor() {
85         testProperty("BorderColor", new PropertyTester() {
86             protected Object getNewValue(String p, Object old) {
87                 return utils.isVoid(old) ? new Integer(1234) : null ;
88             }
89         }) ;
90     }
91 
92     /**
93     * This property can be void, so if old value is <code> null </code>
94     * new value must be specified.
95     */
_TextColor()96     public void _TextColor() {
97         testProperty("TextColor", new PropertyTester() {
98             protected Object getNewValue(String prop, Object old) {
99                 return utils.isVoid(old) ? new Integer(123) : null ;
100             }
101         }) ;
102     }
103 
104     /**
105     * This property can be void, so if old value is <code> null </code>
106     * new value must be specified.
107     */
_TextLineColor()108     public void _TextLineColor() {
109         testProperty("TextLineColor", new PropertyTester() {
110             protected Object getNewValue(String prop, Object old) {
111                 return utils.isVoid(old) ? new Integer(123) : null ;
112             }
113         }) ;
114     }
115 
116     /**
117     * This property can be void, so if old value is <code> null </code>
118     * new value must be specified.
119     */
_Value()120     public void _Value() {
121         testProperty("Value", new PropertyTester() {
122             protected Object getNewValue(String prop, Object old) {
123                 return utils.isVoid(old) ? new Double(777) :
124                     super.getNewValue(prop, old) ;
125             }
126         }) ;
127     }
128 }
129 
130