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 .
22 import lib
.MultiMethodTest
;
24 import com
.sun
.star
.awt
.XButton
;
27 * Testing <code>com.sun.star.awt.XButton</code>
30 * <li><code> addActionListener()</code></li>
31 * <li><code> removeActionListener()</code></li>
32 * <li><code> setLabel()</code></li>
33 * <li><code> setActionCommand()</code></li>
35 * Test is <b> NOT </b> multithread compliant. <p>
36 * @see com.sun.star.awt.XButton
38 public class _XButton
extends MultiMethodTest
{
40 public XButton oObj
= null;
43 * Listener implementation which sets flags on appropriate method calls
45 protected static class TestActionListener
implements com
.sun
.star
.awt
.XActionListener
{
47 public void disposing(com
.sun
.star
.lang
.EventObject e
) {
50 public void actionPerformed(com
.sun
.star
.awt
.ActionEvent e
) {}
53 TestActionListener listener
= new TestActionListener() ;
56 * !!! Can be checked only interactively !!!
58 public void _addActionListener() {
60 boolean result
= true ;
61 oObj
.addActionListener(listener
) ;
63 tRes
.tested("addActionListener()", result
) ;
67 * !!! Can be checked only interactively !!!
69 public void _removeActionListener() {
71 boolean result
= true ;
72 oObj
.removeActionListener(listener
) ;
74 tRes
.tested("removeActionListener()", result
) ;
78 * Just sets some text for label. <p>
79 * Has <b> OK </b> status if no runtime exceptions occurred
81 public void _setLabel() {
83 boolean result
= true ;
84 oObj
.setLabel("XButton Label") ;
86 tRes
.tested("setLabel()", result
) ;
90 * Just sets some command for button. <p>
91 * Has <b> OK </b> status if no runtime exceptions occurred
93 public void _setActionCommand() {
95 boolean result
= true ;
96 oObj
.setActionCommand("XButtonCommand") ;
98 tRes
.tested("setActionCommand()", result
) ;