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.form.component;
25 
26 import lib.MultiPropertyTest;
27 
28 import com.sun.star.form.TabulatorCycle;
29 import com.sun.star.uno.Enum;
30 
31 /**
32 * Testing <code>com.sun.star.form.component.DataForm</code>
33 * service properties :
34 * <ul>
35 *  <li><code> MasterFields</code></li>
36 *  <li><code> DetailFields</code></li>
37 *  <li><code> Cycle</code></li>
38 *  <li><code> NavigationBarMode</code></li>
39 *  <li><code> AllowInserts</code></li>
40 *  <li><code> AllowUpdates</code></li>
41 *  <li><code> AllowDeletes</code></li>
42 * </ul> <p>
43 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
44 * @see com.sun.star.form.component.DataForm
45 */
46 public class _DataForm extends MultiPropertyTest {
47 
48     /**
49     * This property can be VOID, and in case if it is so new
50     * value must be defined.
51     */
_NavigationBarMode()52     public void _NavigationBarMode() {
53         testProperty("NavigationBarMode", new PropertyTester() {
54             public String toString(Object obj) {
55                 if (util.utils.isVoid(obj)) {
56                     return "null";
57                 } else {
58                     return "(" + obj.getClass().toString() + ")"
59                             + ((Enum)obj).getValue();
60                 }
61             }
62         });
63     }
64 
65     /**
66     * This property can be VOID, and in case if it is so new
67     * value must be defined.
68     */
_Cycle()69     public void _Cycle() {
70         testProperty("Cycle", new PropertyTester() {
71             public Object getNewValue(String propName, Object oldValue) {
72                 return TabulatorCycle.CURRENT;
73             }
74             public String toString(Object obj) {
75                 if (util.utils.isVoid(obj))
76                     return "null";
77                 else
78                     return "(" + obj.getClass().toString() + ")"
79                             + ((Enum)obj).getValue();
80             }
81         });
82     }
83 
84 }
85 
86