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.text;
25 
26 import lib.MultiPropertyTest;
27 
28 /**
29  * Testing <code>com.sun.star.text.TextTable</code>
30  * service properties :
31  * <ul>
32  *  <li><code> BreakType</code></li>
33  *  <li><code> LeftMargin</code></li>
34  *  <li><code> RightMargin</code></li>
35  *  <li><code> HoriOrient</code></li>
36  *  <li><code> KeepTogether</code></li>
37  *  <li><code> Split</code></li>
38  *  <li><code> PageNumberOffset</code></li>
39  *  <li><code> PageDescName</code></li>
40  *  <li><code> RelativeWidth</code></li>
41  *  <li><code> IsWidthRelative</code></li>
42  *  <li><code> RepeatHeadline</code></li>
43  *  <li><code> ShadowFormat</code></li>
44  *  <li><code> TopMargin</code></li>
45  *  <li><code> BottomMargin</code></li>
46  *  <li><code> BackTransparent</code></li>
47  *  <li><code> Width</code></li>
48  *  <li><code> ChartRowAsLabel</code></li>
49  *  <li><code> ChartColumnAsLabel</code></li>
50  *  <li><code> TableBorder</code></li>
51  *  <li><code> TableColumnSeparators</code></li>
52  *  <li><code> TableColumnRelativeSum</code></li>
53  *  <li><code> BackColor</code></li>
54  *  <li><code> BackGraphicURL</code></li>
55  *  <li><code> BackGraphicFilter</code></li>
56  *  <li><code> BackGraphicLocation</code></li>
57  * </ul> <p>
58  * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
59  * @see com.sun.star.text.TextTable
60  */
61 public class _TextTable extends MultiPropertyTest {
62 
63     /**
64      * This property accepts only restricted range of values.
65      * The property value is switched between '' and 'Standard'
66      * strings.
67      */
_PageDescName()68     public void _PageDescName() {
69         testProperty("PageDescName", "Endnote", "Standard");
70     }
71 
72     /**
73      * For setting this property, 'HoriOrient' property must be
74      * set to non-automatic.
75      */
_Width()76     public void _Width() {
77         Short align = new Short(com.sun.star.text.HoriOrientation.CENTER);
78         try {
79           oObj.setPropertyValue("HoriOrient",align);
80         }
81         catch (com.sun.star.lang.IllegalArgumentException ex) {}
82         catch (com.sun.star.lang.WrappedTargetException ex) {}
83         catch (com.sun.star.beans.PropertyVetoException ex) {}
84         catch (com.sun.star.beans.UnknownPropertyException ex) {}
85 
86         testProperty("Width");
87     }
88 
89     /**
90      * For setting this property, 'HoriOrient' property must be
91      * set to non-automatic.
92      */
_RelativeWidth()93     public void _RelativeWidth() {
94         Short align = new Short(com.sun.star.text.HoriOrientation.CENTER);
95         try {
96           oObj.setPropertyValue("HoriOrient",align);
97         }
98         catch (com.sun.star.lang.IllegalArgumentException ex) {}
99         catch (com.sun.star.lang.WrappedTargetException ex) {}
100         catch (com.sun.star.beans.PropertyVetoException ex) {}
101         catch (com.sun.star.beans.UnknownPropertyException ex) {}
102 
103         testProperty("RelativeWidth");
104     }
105 
106     /**
107     * Forces environment recreation.
108     */
after()109     protected void after() {
110         disposeEnvironment();
111     }
112 
113 } // finish class _TextTable
114 
115