tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / qadevOOo / tests / java / ifc / ui / _XUIConfiguration.java
blob73290288c89c28095234ccd0ec4661bb2cc66e6c
1 /*
2 * This file is part of the LibreOffice project.
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/.
8 * This file incorporates work covered by the following license notice:
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 .
19 package ifc.ui;
21 import com.sun.star.ui.XUIConfiguration;
22 import com.sun.star.ui.XUIConfigurationListener;
23 import lib.MultiMethodTest;
25 /**
26 * Testing <code>com.sun.star.ui.XUIConfiguration</code>
27 * interface methods :
28 * <ul>
29 * <li><code> addConfigurationListener()</code></li>
30 * <li><code> removeConfigurationListener()</code></li>
31 * </ul> <p>
32 * Test is <b> NOT </b> multithread compliant. <p>
33 * After test completion object environment has to be recreated.
34 * @see com.sun.star.ui.XUIConfiguration
37 public class _XUIConfiguration extends MultiMethodTest {
39 public XUIConfiguration oObj;
40 XUIConfigurationListenerImpl xListener = null;
42 /**
43 * Interface for the Listener of the object relation
44 * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
45 * @see com.sun.star.ui.XUIConfigurationListener
47 public interface XUIConfigurationListenerImpl
48 extends XUIConfigurationListener {
49 void reset();
50 void fireEvent();
51 boolean actionWasTriggered();
55 /**
56 * try to get a listener out of the object relation
57 * <CODE>XUIConfiguration.XUIConfigurationListenerImpl</CODE>
59 @Override
60 public void before() {
61 xListener = (XUIConfigurationListenerImpl)tEnv.getObjRelation(
62 "XUIConfiguration.XUIConfigurationListenerImpl");
65 /**
66 * adds a listener and fires an event
67 * Has <B>OK</B> status if listener was called
69 public void _addConfigurationListener() {
70 oObj.addConfigurationListener(xListener);
71 xListener.fireEvent();
72 tRes.tested("addConfigurationListener()", xListener.actionWasTriggered());
75 /**
76 * removes the listener and calls an event.
77 * Has <B>OK</B> status if listener is not called.
79 public void _removeConfigurationListener() {
80 requiredMethod("addConfigurationListener()");
81 oObj.removeConfigurationListener(xListener);
82 xListener.reset();
83 xListener.fireEvent();
84 tRes.tested("removeConfigurationListener()", !xListener.actionWasTriggered());
87 /**
88 * Dispose because the UIConfigurationManager has to be recreated
90 @Override
91 public void after() {
92 disposeEnvironment();