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.ui; 25 26 import com.sun.star.container.XIndexAccess; 27 import com.sun.star.ui.XModuleUIConfigurationManager; 28 import lib.MultiMethodTest; 29 30 public class _XModuleUIConfigurationManager extends MultiMethodTest { 31 32 public XModuleUIConfigurationManager oObj = null; 33 private String resourceUrl = null; 34 before()35 public void before() { 36 resourceUrl = (String)tEnv.getObjRelation("XModuleUIConfigurationManager.ResourceURL"); 37 } 38 _isDefaultSettings()39 public void _isDefaultSettings() { 40 boolean result; 41 try { 42 result = oObj.isDefaultSettings(resourceUrl); 43 } 44 catch(com.sun.star.lang.IllegalArgumentException e) { 45 log.println("'" + resourceUrl + "' is an illegal resource."); 46 result = false; 47 } 48 String notPossibleUrl = "private:resource/menubar/dingsbums"; 49 try { 50 result &= !oObj.isDefaultSettings(notPossibleUrl); 51 } 52 catch(com.sun.star.lang.IllegalArgumentException e) { 53 log.println("'" + notPossibleUrl + "' is an illegal resource."); 54 result = false; 55 } 56 57 tRes.tested("isDefaultSettings()", result); 58 } 59 _getDefaultSettings()60 public void _getDefaultSettings() { 61 boolean result; 62 try { 63 XIndexAccess xIndexAcc = oObj.getDefaultSettings(resourceUrl); 64 result = xIndexAcc != null; 65 } 66 catch(com.sun.star.lang.IllegalArgumentException e) { 67 log.println("'" + resourceUrl + "' is an illegal resource."); 68 result = false; 69 } 70 catch(com.sun.star.container.NoSuchElementException e) { 71 log.println("No resource '" + resourceUrl + "' available."); 72 result = false; 73 } 74 tRes.tested("getDefaultSettings()", result); 75 } 76 77 } 78