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