/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ package ifc.ui; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XIndexAccess; import com.sun.star.container.XIndexContainer; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XSingleComponentFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.ui.UIElementType; import com.sun.star.ui.XImageManager; import com.sun.star.ui.XUIConfigurationManager; import java.io.PrintWriter; import lib.MultiMethodTest; public class _XUIConfigurationManager extends MultiMethodTest { public XUIConfigurationManager oObj; private String msResourceUrl = "private:resource/menubar/menubar"; private String msMyResourceUrl = "private:resource/menubar/mymenubar"; private XIndexContainer mxSettings = null; private XIndexAccess mxMenuBarSettings = null; private XMultiServiceFactory mxMSF = null; private String sShortCutManagerServiceName = null; /** * Some stuff before the tests: * extract the multi service factory. */ protected void before() { mxMSF = (XMultiServiceFactory)tParam.getMSF(); sShortCutManagerServiceName = (String)tEnv.getObjRelation("XConfigurationManager.ShortCutManager"); } /** * reset all changes: do at the end. */ public void _reset() { requiredMethod("removeSettings()"); oObj.reset(); tRes.tested("reset()", true); } public void _getUIElementsInfo() { boolean result = true; try { PropertyValue[][]props = oObj.getUIElementsInfo(UIElementType.UNKNOWN); for (int i=0; i