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.sheet;
25 
26 import lib.MultiPropertyTest;
27 
28 import com.sun.star.lang.Locale;
29 
30 /**
31 * Testing <code>com.sun.star.sheet.TableAutoFormatField</code>
32 * service properties :
33 * <ul>
34 *  <li><code> CharFontName</code></li>
35 *  <li><code> CharHeight</code></li>
36 *  <li><code> CharWeight</code></li>
37 *  <li><code> CharPosture</code></li>
38 *  <li><code> CharUnderline</code></li>
39 *  <li><code> CharCrossedOut</code></li>
40 *  <li><code> CharContoured</code></li>
41 *  <li><code> CharShadowed</code></li>
42 *  <li><code> CharColor</code></li>
43 *  <li><code> CharLocale</code></li>
44 *  <li><code> CellBackColor</code></li>
45 *  <li><code> IsCellBackgroundTransparent</code></li>
46 *  <li><code> ShadowFormat</code></li>
47 *  <li><code> ParaRightMargin </code></li>
48 *  <li><code> ParaLeftMargin </code></li>
49 *  <li><code> ParaBottomMargin    </code></li>
50 *  <li><code> ParaTopMargin </code></li>
51 *  <li><code> RotateReference </code></li>
52 *  <li><code> RotateAngle </code></li>
53 *  <li><code> Orientation </code></li>
54 *  <li><code> IsTextWrapped </code></li>
55 *  <li><code> VertJustify </code></li>
56 *  <li><code> HoriJustify </code></li>
57 *  <li><code> CharPostureComplex </code></li>
58 *  <li><code> CharPostureAsian    </code></li>
59 *  <li><code> CharWeightComplex </code></li>
60 *  <li><code> CharWeightAsian </code></li>
61 *  <li><code> CharHeightComplex </code></li>
62 *  <li><code> CharHeightAsian </code></li>
63 *  <li><code> CharFontPitchComplex    </code></li>
64 *  <li><code> CharFontPitchAsian </code></li>
65 *  <li><code> CharFontPitch </code></li>
66 *  <li><code> CharFontFamilyComplex </code></li>
67 *  <li><code> CharFontFamilyAsian </code></li>
68 *  <li><code> CharFontFamily </code></li>
69 *  <li><code> CharFontCharSetComplex </code></li>
70 *  <li><code> CharFontCharSetAsian    </code></li>
71 *  <li><code> CharFontCharSet </code></li>
72 *  <li><code> CharFontStyleNameComplex    </code></li>
73 *  <li><code> CharFontStyleNameAsian </code></li>
74 *  <li><code> CharFontStyleName </code></li>
75 *  <li><code> CharFontNameComplex </code></li>
76 *  <li><code> CharFontNameAsian </code></li>
77 * </ul> <p>
78 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
79 * @see com.sun.star.sheet.TableAutoFormatField
80 */
81 public class _TableAutoFormatField extends MultiPropertyTest {
82 
83     /**
84     * Only some values can be used (which identify font name).
85     * In this property value is changed from 'Times New Roman'
86     * to 'Courier' and vise versa.
87     */
_CharFontName()88     public void _CharFontName() {
89         testProperty("CharFontName", new PropertyTester() {
90             protected Object getNewValue(String p, Object old) {
91                 return "Courier".equals(old) ? "Times New Roman" : "Courier" ;
92             }
93         }) ;
94     }
95 
96     /**
97     * Locale values are predefined and can't be chaged arbitrary.
98     * In this property value is changed from ('de', 'DE', '')
99     * to ('es', 'ES', '') and vise versa.
100     */
_CharLocale()101     public void _CharLocale() {
102         testProperty("CharLocale", new PropertyTester() {
103             protected Object getNewValue(String p, Object old) {
104                 return old == null || ((Locale)old).Language == "de" ?
105                     new Locale("es", "ES", "") : new Locale("de", "DE", "") ;
106             }
107         }) ;
108     }
109 
110     /**
111     * This property can be void, so if old value is <code> null </code>
112     * new value must be specified.
113     */
_ShadowFormat()114     public void _ShadowFormat() {
115         testProperty("ShadowFormat", new PropertyTester() {
116             protected Object getNewValue(String p, Object old) {
117                 return old == null ? new com.sun.star.table.ShadowFormat() :
118                     super.getNewValue(p, old) ;
119             }
120         }) ;
121     }
122 
123 } //finish class _TableAutoFormatField
124 
125 
126 
127