1*76b6b121SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*76b6b121SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*76b6b121SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*76b6b121SAndrew Rist * distributed with this work for additional information 6*76b6b121SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*76b6b121SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*76b6b121SAndrew Rist * "License"); you may not use this file except in compliance 9*76b6b121SAndrew Rist * with the License. You may obtain a copy of the License at 10*76b6b121SAndrew Rist * 11*76b6b121SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*76b6b121SAndrew Rist * 13*76b6b121SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*76b6b121SAndrew Rist * software distributed under the License is distributed on an 15*76b6b121SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*76b6b121SAndrew Rist * KIND, either express or implied. See the License for the 17*76b6b121SAndrew Rist * specific language governing permissions and limitations 18*76b6b121SAndrew Rist * under the License. 19*76b6b121SAndrew Rist * 20*76b6b121SAndrew Rist *************************************************************/ 21*76b6b121SAndrew Rist 22*76b6b121SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package complex.imageManager; 25cdf0e10cSrcweir 26cdf0e10cSrcweir 27cdf0e10cSrcweir import com.sun.star.ui.XUIConfiguration; 28cdf0e10cSrcweir import com.sun.star.ui.XUIConfigurationListener; 29cdf0e10cSrcweir import lib.TestParameters; 30cdf0e10cSrcweir 31cdf0e10cSrcweir 32cdf0e10cSrcweir 33cdf0e10cSrcweir public class _XUIConfiguration { 34cdf0e10cSrcweir 35cdf0e10cSrcweir 36cdf0e10cSrcweir TestParameters tEnv = null; 37cdf0e10cSrcweir public XUIConfiguration oObj; 38cdf0e10cSrcweir XUIConfigurationListenerImpl xListener = null; 39cdf0e10cSrcweir 40cdf0e10cSrcweir public static interface XUIConfigurationListenerImpl 41cdf0e10cSrcweir extends XUIConfigurationListener { reset()42cdf0e10cSrcweir public void reset(); fireEvent()43cdf0e10cSrcweir public void fireEvent(); actionWasTriggered()44cdf0e10cSrcweir public boolean actionWasTriggered(); 45cdf0e10cSrcweir } 46cdf0e10cSrcweir 47cdf0e10cSrcweir _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj)48cdf0e10cSrcweir public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) { 49cdf0e10cSrcweir this.tEnv = tEnv; 50cdf0e10cSrcweir this.oObj = oObj; 51cdf0e10cSrcweir } 52cdf0e10cSrcweir before()53cdf0e10cSrcweir public void before() { 54cdf0e10cSrcweir xListener = (XUIConfigurationListenerImpl)tEnv.get( 55cdf0e10cSrcweir "XUIConfiguration.XUIConfigurationListenerImpl"); 56cdf0e10cSrcweir XUIConfigurationListener l; 57cdf0e10cSrcweir } 58cdf0e10cSrcweir _addConfigurationListener()59cdf0e10cSrcweir public boolean _addConfigurationListener() { 60cdf0e10cSrcweir oObj.addConfigurationListener(xListener); 61cdf0e10cSrcweir xListener.fireEvent(); 62cdf0e10cSrcweir return xListener.actionWasTriggered(); 63cdf0e10cSrcweir } 64cdf0e10cSrcweir _removeConfigurationListener()65cdf0e10cSrcweir public boolean _removeConfigurationListener() { 66cdf0e10cSrcweir oObj.removeConfigurationListener(xListener); 67cdf0e10cSrcweir xListener.reset(); 68cdf0e10cSrcweir xListener.fireEvent(); 69cdf0e10cSrcweir return !xListener.actionWasTriggered(); 70cdf0e10cSrcweir } 71cdf0e10cSrcweir 72cdf0e10cSrcweir /** 73cdf0e10cSrcweir * Dispose because the UIConfigurationManager has to be recreated 74cdf0e10cSrcweir */ after()75cdf0e10cSrcweir public void after() { 76cdf0e10cSrcweir // disposeEnvironment(); 77cdf0e10cSrcweir } 78cdf0e10cSrcweir } 79