/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * 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 . */ 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. */ @Override protected void before() { mxMSF = 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