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 complex.imageManager; 25 26 27 import com.sun.star.ui.XUIConfiguration; 28 import com.sun.star.ui.XUIConfigurationListener; 29 import lib.TestParameters; 30 31 32 33 public class _XUIConfiguration { 34 35 36 TestParameters tEnv = null; 37 public XUIConfiguration oObj; 38 XUIConfigurationListenerImpl xListener = null; 39 40 public static interface XUIConfigurationListenerImpl 41 extends XUIConfigurationListener { 42 public void reset(); 43 public void fireEvent(); 44 public boolean actionWasTriggered(); 45 } 46 47 48 public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) { 49 this.tEnv = tEnv; 50 this.oObj = oObj; 51 } 52 53 public void before() { 54 xListener = (XUIConfigurationListenerImpl)tEnv.get( 55 "XUIConfiguration.XUIConfigurationListenerImpl"); 56 XUIConfigurationListener l; 57 } 58 59 public boolean _addConfigurationListener() { 60 oObj.addConfigurationListener(xListener); 61 xListener.fireEvent(); 62 return xListener.actionWasTriggered(); 63 } 64 65 public boolean _removeConfigurationListener() { 66 oObj.removeConfigurationListener(xListener); 67 xListener.reset(); 68 xListener.fireEvent(); 69 return !xListener.actionWasTriggered(); 70 } 71 72 /** 73 * Dispose because the UIConfigurationManager has to be recreated 74 */ 75 public void after() { 76 // disposeEnvironment(); 77 } 78 } 79