Debian Codegraph @

framework/qa/complex/imageManager/_XUIConfiguration.java

raw
1 /*
2 * This file is part of the LibreOffice project.
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 *
8 * This file incorporates work covered by the following license notice:
9 *
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 */
18
19 package complex.imageManager;
20
21
22 import com.sun.star.ui.XUIConfiguration;
23 import com.sun.star.ui.XUIConfigurationListener;
24 import lib.TestParameters;
25
26
27
28 public class _XUIConfiguration {
29
30
31 private final TestParameters tEnv;
32 private final XUIConfiguration oObj;
33 private XUIConfigurationListenerImpl xListener = null;
34
35 public interface XUIConfigurationListenerImpl
36 extends XUIConfigurationListener {
37 void reset();
38 void fireEvent();
39 boolean actionWasTriggered();
40 }
41
42
43 public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) {
44 this.tEnv = tEnv;
45 this.oObj = oObj;
46 }
47
48 public void before() {
49 xListener = (XUIConfigurationListenerImpl)tEnv.get(
50 "XUIConfiguration.XUIConfigurationListenerImpl");
51 }
52
53 public boolean _addConfigurationListener() {
54 oObj.addConfigurationListener(xListener);
55 xListener.fireEvent();
56 return xListener.actionWasTriggered();
57 }
58
59 public boolean _removeConfigurationListener() {
60 oObj.removeConfigurationListener(xListener);
61 xListener.reset();
62 xListener.fireEvent();
63 return !xListener.actionWasTriggered();
64 }
65
66 }