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