1ef39d40dSAndrew Rist /************************************************************** 2ef39d40dSAndrew Rist * 3ef39d40dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ef39d40dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5ef39d40dSAndrew Rist * distributed with this work for additional information 6ef39d40dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ef39d40dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8ef39d40dSAndrew Rist * "License"); you may not use this file except in compliance 9ef39d40dSAndrew Rist * with the License. You may obtain a copy of the License at 10ef39d40dSAndrew Rist * 11ef39d40dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12ef39d40dSAndrew Rist * 13ef39d40dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14ef39d40dSAndrew Rist * software distributed under the License is distributed on an 15ef39d40dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ef39d40dSAndrew Rist * KIND, either express or implied. See the License for the 17ef39d40dSAndrew Rist * specific language governing permissions and limitations 18ef39d40dSAndrew Rist * under the License. 19ef39d40dSAndrew Rist * 20ef39d40dSAndrew Rist *************************************************************/ 21ef39d40dSAndrew Rist 22*0ff85987Smseidel 23*0ff85987Smseidel 24cdf0e10cSrcweir package helper; 25cdf0e10cSrcweir 26cdf0e10cSrcweir import com.sun.star.uno.*; 27cdf0e10cSrcweir import com.sun.star.lang.*; 28cdf0e10cSrcweir import com.sun.star.container.*; 29cdf0e10cSrcweir import com.sun.star.beans.*; 30cdf0e10cSrcweir import com.sun.star.util.*; 31cdf0e10cSrcweir 32cdf0e10cSrcweir /** 33cdf0e10cSrcweir * This <CODE>ConfigHelper</CODE> makes it possible to access the 34cdf0e10cSrcweir * configuration and change their content.<P> 35cdf0e10cSrcweir * <P> 36cdf0e10cSrcweir * Example: <P> 37cdf0e10cSrcweir * Listing of the <CODE>Configuration</CODE> Views.xcu:<P> 38cdf0e10cSrcweir * <oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Views" oor:package="org.openoffice.Office"><p> 39cdf0e10cSrcweir * <node oor:name="Windows"><P> 40cdf0e10cSrcweir * <<node oor:name="SplitWindow0" oor:op="replace"><P> 41cdf0e10cSrcweir * <prop oor:name="Visible" oor:type="xs:boolean"><P> 42cdf0e10cSrcweir * <value>false</value><P> 43cdf0e10cSrcweir * </prop><P> 44cdf0e10cSrcweir * <prop oor:name="WindowState" oor:type="xs:string"><P> 45cdf0e10cSrcweir * <value/><P> 46cdf0e10cSrcweir * </prop><P> 47cdf0e10cSrcweir * <node oor:name="UserData"><P> 48cdf0e10cSrcweir * <prop oor:name="UserItem" oor:op="replace" 49cdf0e10cSrcweir * oor:type="xs:string"><P> 50cdf0e10cSrcweir * <value>V1,2,0</value><P> 51cdf0e10cSrcweir * </prop><P> 52cdf0e10cSrcweir * </node><P> 53cdf0e10cSrcweir * </node><P> 54cdf0e10cSrcweir * </node><P> 55cdf0e10cSrcweir * <P> 56cdf0e10cSrcweir * <CODE>Definition</CODE><P> 57cdf0e10cSrcweir * <ul> 58cdf0e10cSrcweir * <li><CODE><node oor:name="Windows"></CODE> 59cdf0e10cSrcweir * represents a <CODE>Set</CODE> and is a <CODE>XNameContainer</CODE></LI> 60cdf0e10cSrcweir * <li><CODE><node oor:name="SplitWindow0"></CODE> 61cdf0e10cSrcweir * represents a <CODE>Group</CODE> and is a <CODE>XNameReplace</CODE></LI> 62cdf0e10cSrcweir * <li><CODE><prop oor:name="Visible"></CODE> 63cdf0e10cSrcweir * represents a pr<CODE></CODE>operty of the group</li> 64cdf0e10cSrcweir * <li><CODE><node oor:name="UserData"></CODE> 65cdf0e10cSrcweir * represents a <CODE>extensible group</CODE> and is a <CODE>XNameContainer</CODE></LI> 66cdf0e10cSrcweir * <li><CODE><prop oor:name="UserItem"></CODE> 67cdf0e10cSrcweir * represents a <CODE>property</CODE> of the extensible group</LI> 68cdf0e10cSrcweir * </UL> 69bb6af6bcSPedro Giffuni * We assume in the following examples the existence of:<P> 70cdf0e10cSrcweir * <CODE>ConfigHelper aConfig = new ConfigHelper(xMSF, "org.openoffice.Office.Views", false);</CODE> 71cdf0e10cSrcweir * <ul> 72cdf0e10cSrcweir * <li>If you like to insert a new <CODE>Group</CODE> into the <CODE>Set</CODE> "Windows":<p> 73cdf0e10cSrcweir * <CODE>XNameReplace xMyGroup = aConfig.getOrInsertGroup("Windows", "myGroup");</CODE><P> 74cdf0e10cSrcweir * The method <CODE>getOrInsertGroup()</CODE> uses the 75cdf0e10cSrcweir * <CODE>XSingleServiceFactory</CODE> to create the skeleton of a new group. 76cdf0e10cSrcweir * 77cdf0e10cSrcweir * </li> 78cdf0e10cSrcweir * <li>If you like to change the property "WindowState" of "myGroup" 79cdf0e10cSrcweir * of the Set "Windows"<p> 80cdf0e10cSrcweir * <CODE>aConfig.updateGroupProperty( 81cdf0e10cSrcweir * "Windows","myGroup", "WindowState", "952,180,244,349;1;0,0,0,0;");</CODE> 82cdf0e10cSrcweir * </li> 83cdf0e10cSrcweir * <li>If you like to change the property "myProp" of the extensible group 84cdf0e10cSrcweir * "myExtGroup" which is an extensible group of "my2ndGroup" of the 85cdf0e10cSrcweir * Set "Windows":<p> 86cdf0e10cSrcweir * <CODE>aConfig.insertOrUpdateExtensibleGroupProperty( 87cdf0e10cSrcweir * "Windows", "my2ndGroup", "myExtGroup", "myProp","TheValue");</CODE> 88cdf0e10cSrcweir * </li> 89cdf0e10cSrcweir * </ul> 90cdf0e10cSrcweir */ 91cdf0e10cSrcweir public class ConfigHelper 92cdf0e10cSrcweir { 93cdf0e10cSrcweir private XMultiServiceFactory m_xSMGR = null; 94cdf0e10cSrcweir private XHierarchicalNameAccess m_xConfig = null; 95cdf0e10cSrcweir 96cdf0e10cSrcweir //----------------------------------------------- ConfigHelper(XMultiServiceFactory xSMGR , String sConfigPath , boolean bReadOnly )97cdf0e10cSrcweir public ConfigHelper(XMultiServiceFactory xSMGR , 98cdf0e10cSrcweir String sConfigPath , 99cdf0e10cSrcweir boolean bReadOnly ) 100cdf0e10cSrcweir throws com.sun.star.uno.Exception 101cdf0e10cSrcweir { 102cdf0e10cSrcweir m_xSMGR = xSMGR; 103cdf0e10cSrcweir 104cdf0e10cSrcweir XMultiServiceFactory xConfigRoot = (XMultiServiceFactory) 105cdf0e10cSrcweir UnoRuntime.queryInterface( 106cdf0e10cSrcweir XMultiServiceFactory.class, 107cdf0e10cSrcweir m_xSMGR.createInstance( 108cdf0e10cSrcweir "com.sun.star.configuration.ConfigurationProvider")); 109cdf0e10cSrcweir 110cdf0e10cSrcweir PropertyValue[] lParams = new PropertyValue[1]; 111cdf0e10cSrcweir lParams[0] = new PropertyValue(); 112cdf0e10cSrcweir lParams[0].Name = "nodepath"; 113cdf0e10cSrcweir lParams[0].Value = sConfigPath; 114cdf0e10cSrcweir 115cdf0e10cSrcweir Object aConfig; 116cdf0e10cSrcweir if (bReadOnly) 117cdf0e10cSrcweir aConfig = xConfigRoot.createInstanceWithArguments( 118cdf0e10cSrcweir "com.sun.star.configuration.ConfigurationAccess", 119cdf0e10cSrcweir lParams); 120cdf0e10cSrcweir else 121cdf0e10cSrcweir aConfig = xConfigRoot.createInstanceWithArguments( 122cdf0e10cSrcweir "com.sun.star.configuration.ConfigurationUpdateAccess", 123cdf0e10cSrcweir lParams); 124cdf0e10cSrcweir 125cdf0e10cSrcweir m_xConfig = (XHierarchicalNameAccess)UnoRuntime.queryInterface( 126cdf0e10cSrcweir XHierarchicalNameAccess.class, 127cdf0e10cSrcweir aConfig); 128cdf0e10cSrcweir 129cdf0e10cSrcweir if (m_xConfig == null) 130cdf0e10cSrcweir throw new com.sun.star.uno.Exception("Could not open configuration \""+sConfigPath+"\""); 131cdf0e10cSrcweir } 132cdf0e10cSrcweir 133cdf0e10cSrcweir //----------------------------------------------- readRelativeKey(String sRelPath, String sKey )134cdf0e10cSrcweir public Object readRelativeKey(String sRelPath, 135cdf0e10cSrcweir String sKey ) 136cdf0e10cSrcweir throws com.sun.star.container.NoSuchElementException 137cdf0e10cSrcweir { 138cdf0e10cSrcweir try 139cdf0e10cSrcweir { 140cdf0e10cSrcweir XPropertySet xPath = (XPropertySet)UnoRuntime.queryInterface( 141cdf0e10cSrcweir XPropertySet.class, 142cdf0e10cSrcweir m_xConfig.getByHierarchicalName(sRelPath)); 143cdf0e10cSrcweir return xPath.getPropertyValue(sKey); 144cdf0e10cSrcweir } 145cdf0e10cSrcweir catch(com.sun.star.uno.Exception ex) 146cdf0e10cSrcweir { 147cdf0e10cSrcweir throw new com.sun.star.container.NoSuchElementException(ex.getMessage()); 148cdf0e10cSrcweir } 149cdf0e10cSrcweir } 150cdf0e10cSrcweir 151cdf0e10cSrcweir //----------------------------------------------- writeRelativeKey(String sRelPath, String sKey , Object aValue )152cdf0e10cSrcweir public void writeRelativeKey(String sRelPath, 153cdf0e10cSrcweir String sKey , 154cdf0e10cSrcweir Object aValue ) 155cdf0e10cSrcweir throws com.sun.star.container.NoSuchElementException 156cdf0e10cSrcweir { 157cdf0e10cSrcweir try 158cdf0e10cSrcweir { 159cdf0e10cSrcweir XPropertySet xPath = (XPropertySet)UnoRuntime.queryInterface( 160cdf0e10cSrcweir XPropertySet.class, 161cdf0e10cSrcweir m_xConfig.getByHierarchicalName(sRelPath)); 162cdf0e10cSrcweir xPath.setPropertyValue(sKey, aValue); 163cdf0e10cSrcweir } 164cdf0e10cSrcweir catch(com.sun.star.uno.Exception ex) 165cdf0e10cSrcweir { 166cdf0e10cSrcweir throw new com.sun.star.container.NoSuchElementException(ex.getMessage()); 167cdf0e10cSrcweir } 168cdf0e10cSrcweir } 169cdf0e10cSrcweir 170cdf0e10cSrcweir //----------------------------------------------- 171cdf0e10cSrcweir /** 172cdf0e10cSrcweir * Updates the configuration.<p> 173cdf0e10cSrcweir * This must be called after you have changed the configuration 174*0ff85987Smseidel * else your changes will be lost. 175cdf0e10cSrcweir */ flush()176cdf0e10cSrcweir public void flush() 177cdf0e10cSrcweir { 178cdf0e10cSrcweir try 179cdf0e10cSrcweir { 180cdf0e10cSrcweir XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface( 181cdf0e10cSrcweir XChangesBatch.class, 182cdf0e10cSrcweir m_xConfig); 183cdf0e10cSrcweir xBatch.commitChanges(); 184cdf0e10cSrcweir } 185cdf0e10cSrcweir catch(com.sun.star.uno.Exception ex) 186cdf0e10cSrcweir {} 187cdf0e10cSrcweir } 188cdf0e10cSrcweir 189cdf0e10cSrcweir //----------------------------------------------- readDirectKey(XMultiServiceFactory xSMGR , String sConfigFile, String sRelPath , String sKey )190cdf0e10cSrcweir public static Object readDirectKey(XMultiServiceFactory xSMGR , 191cdf0e10cSrcweir String sConfigFile, 192cdf0e10cSrcweir String sRelPath , 193cdf0e10cSrcweir String sKey ) 194cdf0e10cSrcweir throws com.sun.star.uno.Exception 195cdf0e10cSrcweir { 196cdf0e10cSrcweir ConfigHelper aConfig = new ConfigHelper(xSMGR, sConfigFile, true); 197cdf0e10cSrcweir return aConfig.readRelativeKey(sRelPath, sKey); 198cdf0e10cSrcweir } 199cdf0e10cSrcweir 200cdf0e10cSrcweir //----------------------------------------------- writeDirectKey(XMultiServiceFactory xSMGR , String sConfigFile, String sRelPath , String sKey , Object aValue )201cdf0e10cSrcweir public static void writeDirectKey(XMultiServiceFactory xSMGR , 202cdf0e10cSrcweir String sConfigFile, 203cdf0e10cSrcweir String sRelPath , 204cdf0e10cSrcweir String sKey , 205cdf0e10cSrcweir Object aValue ) 206cdf0e10cSrcweir throws com.sun.star.uno.Exception 207cdf0e10cSrcweir { 208cdf0e10cSrcweir ConfigHelper aConfig = new ConfigHelper(xSMGR, sConfigFile, false); 209cdf0e10cSrcweir aConfig.writeRelativeKey(sRelPath, sKey, aValue); 210cdf0e10cSrcweir aConfig.flush(); 211cdf0e10cSrcweir } 212cdf0e10cSrcweir 213cdf0e10cSrcweir 214cdf0e10cSrcweir /** 215cdf0e10cSrcweir * Insert a structured node (group) in a name container (set) 216*0ff85987Smseidel * or else update it and return the <CODE>XNameReplace</CODE> of it.<P> 217cdf0e10cSrcweir * The <CODE>XSingleServiceFacttory</CODE> of the <CODE>set</CODE> will be used 218cdf0e10cSrcweir * to create a new group. This group is specific to its set and 219cdf0e10cSrcweir * creates defined entries. 220cdf0e10cSrcweir * @return The [inserted] group of the set 221*0ff85987Smseidel * @param groupName The name of the group which should be returned 222cdf0e10cSrcweir * @param setName The name of the set 223cdf0e10cSrcweir * @throws com.sun.star.uno.Exception throws 224*0ff85987Smseidel * <CODE>com.sun.star.uno.Exception</CODE> on any error. 225cdf0e10cSrcweir */ getOrInsertGroup(String setName, String groupName)226cdf0e10cSrcweir public XNameReplace getOrInsertGroup(String setName, String groupName) 227cdf0e10cSrcweir throws com.sun.star.uno.Exception 228cdf0e10cSrcweir 229cdf0e10cSrcweir { 230cdf0e10cSrcweir XNameContainer xSetCont = this.getSet(setName); 231cdf0e10cSrcweir 232cdf0e10cSrcweir XNameReplace xChildAccess = null; 233cdf0e10cSrcweir 234cdf0e10cSrcweir try { 235cdf0e10cSrcweir Object xChild=xSetCont.getByName(groupName); 236cdf0e10cSrcweir xChildAccess = (XNameReplace) UnoRuntime.queryInterface( 237cdf0e10cSrcweir XNameReplace.class,xSetCont); 238cdf0e10cSrcweir } catch(com.sun.star.container.NoSuchElementException e) { 239cdf0e10cSrcweir // proceed with inserting 240cdf0e10cSrcweir } 241cdf0e10cSrcweir 242cdf0e10cSrcweir if (xChildAccess == null) { 243cdf0e10cSrcweir XSingleServiceFactory xChildfactory = (XSingleServiceFactory) 244cdf0e10cSrcweir UnoRuntime.queryInterface(XSingleServiceFactory.class,xSetCont); 245cdf0e10cSrcweir 246cdf0e10cSrcweir Object xNewChild = xChildfactory.createInstance(); 247cdf0e10cSrcweir 248cdf0e10cSrcweir xSetCont.insertByName(groupName, xNewChild); 249cdf0e10cSrcweir 250cdf0e10cSrcweir xChildAccess = (XNameReplace) 251cdf0e10cSrcweir UnoRuntime.queryInterface(XNameContainer.class,xNewChild); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir 254cdf0e10cSrcweir return xChildAccess; 255cdf0e10cSrcweir } 256cdf0e10cSrcweir 257cdf0e10cSrcweir /** 258cdf0e10cSrcweir * Update a property of a group container of a set container 259bb6af6bcSPedro Giffuni * @param setName the name of the <CODE>set</CODE> which contains the <CODE>group</CODE> 260cdf0e10cSrcweir * @param groupName the name of the <CODE>group</CODE> which property should be changed 261cdf0e10cSrcweir * @param propName the name of the property which should be changed 262cdf0e10cSrcweir * @param propValue the value the property should get 263*0ff85987Smseidel * @throws com.sun.star.uno.Exception throws <CODE>com.sun.star.uno.Exception</CODE> on any error. 264cdf0e10cSrcweir */ updateGroupProperty(String setName, String groupName, String propName, Object propValue)265cdf0e10cSrcweir public void updateGroupProperty(String setName, 266cdf0e10cSrcweir String groupName, 267cdf0e10cSrcweir String propName, 268cdf0e10cSrcweir Object propValue) 269cdf0e10cSrcweir throws com.sun.star.uno.Exception 270cdf0e10cSrcweir { 271cdf0e10cSrcweir XNameContainer xSetCont = this.getSet(setName); 272cdf0e10cSrcweir 273cdf0e10cSrcweir XPropertySet xProp = null; 274cdf0e10cSrcweir try { 275cdf0e10cSrcweir xProp = (XPropertySet)UnoRuntime.queryInterface( 276cdf0e10cSrcweir XPropertySet.class, 277cdf0e10cSrcweir xSetCont.getByName(groupName)); 278cdf0e10cSrcweir } catch (com.sun.star.container.NoSuchElementException e){ 279cdf0e10cSrcweir throw new com.sun.star.uno.Exception( 280cdf0e10cSrcweir "could not get group '" + groupName + 281cdf0e10cSrcweir "' from set '"+ setName +"':\n" + e.toString()); 282cdf0e10cSrcweir } 283cdf0e10cSrcweir try{ 284cdf0e10cSrcweir xProp.setPropertyValue(propName, propValue); 285cdf0e10cSrcweir } catch (com.sun.star.uno.Exception e) { 286cdf0e10cSrcweir throw new com.sun.star.uno.Exception( 287cdf0e10cSrcweir "could not set property '" + propName + 288cdf0e10cSrcweir "' from group '"+ groupName + 289cdf0e10cSrcweir "' from set '"+ setName +"':\n" + e.toString()); 290cdf0e10cSrcweir } 291cdf0e10cSrcweir } 292cdf0e10cSrcweir 293cdf0e10cSrcweir 294cdf0e10cSrcweir /** 295cdf0e10cSrcweir * Insert a property in an extensible group container or else update it 296bb6af6bcSPedro Giffuni * @param setName the name of the <CODE>set</CODE> which contains the <CODE>group</CODE> 297*0ff85987Smseidel * @param group The name of the <CODE>group</CODE> which contains the <CODE>extensible group</CODE>. 298cdf0e10cSrcweir * @param extGroup The name of the <CODE>extensible group</CODE> which 299cdf0e10cSrcweir * [should] contain the property 300cdf0e10cSrcweir * @param propName The name of the property. 301cdf0e10cSrcweir * @param propValue The value of the property. 302*0ff85987Smseidel * @throws com.sun.star.uno.Exception throws <CODE>com.sun.star.uno.Exception</CODE> on any error. 303cdf0e10cSrcweir */ insertOrUpdateExtensibleGroupProperty( String setName, String group, String extGroup, String propName, Object propValue)304cdf0e10cSrcweir public void insertOrUpdateExtensibleGroupProperty( 305cdf0e10cSrcweir String setName, 306cdf0e10cSrcweir String group, 307cdf0e10cSrcweir String extGroup, 308cdf0e10cSrcweir String propName, 309cdf0e10cSrcweir Object propValue) 310cdf0e10cSrcweir throws com.sun.star.uno.Exception 311cdf0e10cSrcweir { 312cdf0e10cSrcweir XNameContainer xSetCont = this.getSet(setName); 313cdf0e10cSrcweir 314cdf0e10cSrcweir XNameReplace xGroupAccess = null; 315cdf0e10cSrcweir XNameContainer xExtGroupCont = null; 316cdf0e10cSrcweir 317cdf0e10cSrcweir try { 318cdf0e10cSrcweir Object xGroup=xSetCont.getByName(group); 319cdf0e10cSrcweir xGroupAccess = (XNameReplace) UnoRuntime.queryInterface( 320cdf0e10cSrcweir XNameReplace.class,xGroup); 321cdf0e10cSrcweir } catch(com.sun.star.container.NoSuchElementException e) { 322cdf0e10cSrcweir throw new com.sun.star.uno.Exception( 323cdf0e10cSrcweir "could not get group '" + group + 324cdf0e10cSrcweir "' from set '"+ setName +"':\n" + e.toString()); 325cdf0e10cSrcweir } 326cdf0e10cSrcweir 327cdf0e10cSrcweir try { 328cdf0e10cSrcweir Object xGroup=xGroupAccess.getByName(extGroup); 329cdf0e10cSrcweir xExtGroupCont = (XNameContainer) UnoRuntime.queryInterface( 330cdf0e10cSrcweir XNameContainer.class,xGroup); 331cdf0e10cSrcweir } catch(com.sun.star.container.NoSuchElementException e) { 332cdf0e10cSrcweir throw new com.sun.star.uno.Exception( 333*0ff85987Smseidel "could not get extensible group '"+extGroup+ 334cdf0e10cSrcweir "' from group '"+ group + 335cdf0e10cSrcweir "' from set '"+ setName +"':\n" + e.toString()); 336cdf0e10cSrcweir } 337cdf0e10cSrcweir 338cdf0e10cSrcweir try { 339cdf0e10cSrcweir xExtGroupCont.insertByName(propName, propValue); 340cdf0e10cSrcweir } 341cdf0e10cSrcweir catch(com.sun.star.container.ElementExistException e) { 342cdf0e10cSrcweir xExtGroupCont .replaceByName(propName, propValue); 343cdf0e10cSrcweir } 344cdf0e10cSrcweir 345cdf0e10cSrcweir } 346cdf0e10cSrcweir 347cdf0e10cSrcweir 348cdf0e10cSrcweir /** 349cdf0e10cSrcweir * Returns a <CODE>XNameContainer</CODE> of the <CODE>Set</CODE> 350cdf0e10cSrcweir * of the <CODE>Configuration</CODE> 35130acf5e8Spfg * @param setName the name of the Set which should be returned 352cdf0e10cSrcweir * @throws com.sun.star.uno.Exception on any error 353cdf0e10cSrcweir * @return A XNameContainer of the Set 354cdf0e10cSrcweir */ getSet(String setName)355cdf0e10cSrcweir public XNameContainer getSet(String setName) 356cdf0e10cSrcweir throws com.sun.star.uno.Exception 357cdf0e10cSrcweir { 358cdf0e10cSrcweir XNameReplace xCont = (XNameReplace) 359cdf0e10cSrcweir UnoRuntime.queryInterface(XNameReplace.class, m_xConfig); 360cdf0e10cSrcweir 361cdf0e10cSrcweir Object oSet = xCont.getByName(setName); 362cdf0e10cSrcweir 363cdf0e10cSrcweir if (oSet == null) 364cdf0e10cSrcweir throw new com.sun.star.uno.Exception( 365cdf0e10cSrcweir "could not get set '" + setName + ": null"); 366cdf0e10cSrcweir 367cdf0e10cSrcweir return (XNameContainer) UnoRuntime.queryInterface( 368cdf0e10cSrcweir XNameContainer.class, oSet); 369cdf0e10cSrcweir 370cdf0e10cSrcweir } 371cdf0e10cSrcweir } 372