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 package com.sun.star.wizards.ui.event;
24 
25 import com.sun.star.awt.*;
26 import com.sun.star.lang.EventObject;
27 
28 /**
29  *
30  * @author  rpiterman
31  */
32 public class CommonListener extends AbstractListener implements XActionListener, XItemListener, XTextListener, EventNames, XWindowListener, XMouseListener, XFocusListener, XKeyListener
33 {
34 
35     /** Creates a new instance of CommonListener */
CommonListener()36     public CommonListener()
37     {
38     }
39 
40     /**
41      * Implementation of com.sun.star.awt.XActionListener
42      */
actionPerformed(com.sun.star.awt.ActionEvent actionEvent)43     public void actionPerformed(com.sun.star.awt.ActionEvent actionEvent)
44     {
45         invoke(getEventSourceName(actionEvent), EVENT_ACTION_PERFORMED, actionEvent);
46     }
47 
disposing(com.sun.star.lang.EventObject eventObject)48     public void disposing(com.sun.star.lang.EventObject eventObject)
49     {
50     }
51 
52     /**
53      * Implementation of com.sun.star.awt.XItemListener
54      */
itemStateChanged(ItemEvent itemEvent)55     public void itemStateChanged(ItemEvent itemEvent)
56     {
57         invoke(getEventSourceName(itemEvent), EVENT_ITEM_CHANGED, itemEvent);
58     }
59 
60     /**
61      * Implementation of com.sun.star.awt.XTextListener
62      */
textChanged(TextEvent textEvent)63     public void textChanged(TextEvent textEvent)
64     {
65         invoke(getEventSourceName(textEvent), EVENT_TEXT_CHANGED, textEvent);
66     }
67 
68     /**
69      * @see com.sun.star.awt.XWindowListener#windowResized(com.sun.star.awt.WindowEvent)
70      */
windowResized(WindowEvent event)71     public void windowResized(WindowEvent event)
72     {
73         invoke(getEventSourceName(event), EVENT_WINDOW_RESIZED, event);
74     }
75 
76     /**
77      * @see com.sun.star.awt.XWindowListener#windowMoved(com.sun.star.awt.WindowEvent)
78      */
windowMoved(WindowEvent event)79     public void windowMoved(WindowEvent event)
80     {
81         invoke(getEventSourceName(event), EVENT_WINDOW_MOVED, event);
82     }
83 
84     /**
85      * @see com.sun.star.awt.XWindowListener#windowShown(com.sun.star.lang.EventObject)
86      */
windowShown(EventObject event)87     public void windowShown(EventObject event)
88     {
89         invoke(getEventSourceName(event), EVENT_WINDOW_SHOWN, event);
90     }
91 
92     /**
93      * @see com.sun.star.awt.XWindowListener#windowHidden(com.sun.star.lang.EventObject)
94      */
windowHidden(EventObject event)95     public void windowHidden(EventObject event)
96     {
97         invoke(getEventSourceName(event), EVENT_WINDOW_HIDDEN, event);
98     }
99 
100     /**
101      * @see com.sun.star.awt.XMouseListener#mousePressed(com.sun.star.awt.MouseEvent)
102      */
mousePressed(MouseEvent event)103     public void mousePressed(MouseEvent event)
104     {
105         invoke(getEventSourceName(event), EVENT_MOUSE_PRESSED, event);
106     }
107 
108     /**
109      * @see com.sun.star.awt.XMouseListener#mouseReleased(com.sun.star.awt.MouseEvent)
110      */
mouseReleased(MouseEvent event)111     public void mouseReleased(MouseEvent event)
112     {
113         invoke(getEventSourceName(event), EVENT_KEY_RELEASED, event);
114     }
115 
116     /**
117      * @see com.sun.star.awt.XMouseListener#mouseEntered(com.sun.star.awt.MouseEvent)
118      */
mouseEntered(MouseEvent event)119     public void mouseEntered(MouseEvent event)
120     {
121         invoke(getEventSourceName(event), EVENT_MOUSE_ENTERED, event);
122     }
123 
124     /**
125      * @see com.sun.star.awt.XMouseListener#mouseExited(com.sun.star.awt.MouseEvent)
126      */
mouseExited(MouseEvent event)127     public void mouseExited(MouseEvent event)
128     {
129         invoke(getEventSourceName(event), EVENT_MOUSE_EXITED, event);
130     }
131 
132     /**
133      * @see com.sun.star.awt.XFocusListener#focusGained(com.sun.star.awt.FocusEvent)
134      */
focusGained(FocusEvent event)135     public void focusGained(FocusEvent event)
136     {
137         invoke(getEventSourceName(event), EVENT_FOCUS_GAINED, event);
138     }
139 
140     /**
141      * @see com.sun.star.awt.XFocusListener#focusLost(com.sun.star.awt.FocusEvent)
142      */
focusLost(FocusEvent event)143     public void focusLost(FocusEvent event)
144     {
145         invoke(getEventSourceName(event), EVENT_FOCUS_LOST, event);
146     }
147 
148     /**
149      * @see com.sun.star.awt.XKeyListener#keyPressed(com.sun.star.awt.KeyEvent)
150      */
keyPressed(KeyEvent event)151     public void keyPressed(KeyEvent event)
152     {
153         invoke(getEventSourceName(event), EVENT_KEY_PRESSED, event);
154     }
155 
156     /**
157      * @see com.sun.star.awt.XKeyListener#keyReleased(com.sun.star.awt.KeyEvent)
158      */
keyReleased(KeyEvent event)159     public void keyReleased(KeyEvent event)
160     {
161         invoke(getEventSourceName(event), EVENT_KEY_RELEASED, event);
162     }
163 }
164