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.util; 29 30 import lib.MultiPropertyTest; 31 import util.utils; 32 33 import com.sun.star.lang.XMultiServiceFactory; 34 35 /** 36 * Testing <code>com.sun.star.util.PathSettings</code> 37 * service properties : 38 * <ul> 39 * <li><code> Addin </code></li> 40 * <li><code> AutoCorrect </code></li> 41 * <li><code> AutoText </code></li> 42 * <li><code> Backup </code></li> 43 * <li><code> Basic </code></li> 44 * <li><code> Bitmap </code></li> 45 * <li><code> Config </code></li> 46 * <li><code> Dictionary </code></li> 47 * <li><code> Favorites </code></li> 48 * <li><code> Filter </code></li> 49 * <li><code> Gallery </code></li> 50 * <li><code> Graphic </code></li> 51 * <li><code> Help </code></li> 52 * <li><code> Linguistic </code></li> 53 * <li><code> Module </code></li> 54 * <li><code> Palette </code></li> 55 * <li><code> Plugin </code></li> 56 * <li><code> Storage </code></li> 57 * <li><code> Temp </code></li> 58 * <li><code> Template </code></li> 59 * <li><code> UIConfig </code></li> 60 * <li><code> UserConfig </code></li> 61 * <li><code> UserDictionary</code></li> 62 * <li><code> Work </code></li> 63 * </ul> <p> 64 * 65 * Properties testing is automated by <code>lib.MultiPropertyTest</code>. 66 * @see com.sun.star.util.PathSettings 67 */ 68 public class _PathSettings extends MultiPropertyTest { 69 70 /** 71 * This path list could be empty after SO installation. 72 * And the URL is validated to match the pattern 'file:///*' 73 * thats why the custom changing of this property required. 74 */ 75 public void _UIConfig() { 76 testProperty("UIConfig", new PropertyTester() { 77 public Object getNewValue(String propName, Object oldVal) { 78 String path = (String) oldVal; 79 if (path == null) path = ""; 80 if (path.length() > 0 && !path.endsWith(";")) { 81 path += ";"; 82 } 83 path += utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()); 84 return path; 85 } 86 }); 87 } 88 } 89 90